簡體   English   中英

JW Player電影數據庫服務不適用於野生動物園(所有其他瀏覽器均可用)

[英]JW Player Movie Database service does not work for safari (all other browsers work)

我有一個腳本,可以播放服務提供的電影。

<div id="player1">Loading the player ...</div> 
<script type="text/javascript">
    jwplayer('player1').setup({
        file: "downloadvideo.aspx",
        width: "296",
        height: "240",
        type: "mp4",
    });
</script>

這是提供影片文件的表單加載事件:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles     Me.Load

    Dim filePath As String = "C:\websites\Website2\wdo.mp4"
    Dim Buffer As Byte() = File.ReadAllBytes(filePath)

    Context.Response.Clear()
    Context.Response.Cache.SetCacheability(HttpCacheability.Public)
    Context.Response.Cache.SetLastModified(DateTime.Now)
    Context.Response.AppendHeader("Content-Type", "video/mp4")
    Context.Response.AddHeader("Content-Disposition", "attachment;filename=wdo.mp4")
    Context.Response.AppendHeader("Content-Length", Buffer.Length.ToString())

    Context.Response.BinaryWrite(Buffer)

End Sub

這適用於Internet Explorer,Google Chrome,Firefox。 但不是Safari。

在Safari中,它只有一個永遠旋轉的進度圈。

如果您直接給腳本一個電影文件,它將在safari中正常播放,但是我需要使用此方法為該電影提供電影,因為我的電影將存儲在數據庫中。

試試這個它的工作

受保護的子Page_Load(以對象的ByBy發件人身份,以System.EventArgs的ByVal e屬性)處理Me.Load

Dim filePath As String = "C:\websites\Website2\wdo.mp4"
Dim Buffer As Byte() = File.ReadAllBytes(filePath)

Context.Response.Clear()
Context.Response.AddHeader("Content-Disposition", "attachment;filename=wdo.mp4")
Response.ContentType = "video/mp4"
Context.Response.BinaryWrite(Buffer)

結束子

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM