我想要做的是在 JW Player 中播放一个 .mp4 文件,该文件由数据库以字节为单位给出。
所以这是我的 JW Player 脚本:
<script type="text/javascript">
jwplayer("contvideo").setup({
flashplayer:"jwplayer/player.swf",
file: "downloadvideo.aspx",
provider: "video",
height: 140,
width: 188,
skin: "jwplayer/slim.zip",
modes: [{type:'flash',src:'jwplayer/player.swf'},{type:'html5'},{type:'download'}] });
</script>
该脚本从网页服务 downloadvideo.aspx 接收其电影文件。
downloadvideo.aspx 的代码是:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim bytes() As Byte = System.IO.File.ReadAllBytes("C:\websites\videospecialty\wdo.mp4")
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment;filename=wdo.mp4")
Response.ContentType = "video/mp4"
Response.Flush()
Response.OutputStream.Write(bytes, 0, bytes.Length)
Response.OutputStream.Flush()
Response.End()
End Sub
但是当我尝试这个 JW Player 错误并说找不到他们的视频时。
对此的任何帮助将不胜感激。