2012-06-20 35 views
0

緩衝問題。流水遊戲中的緩衝

這是我的代碼,我設置了autoBuffering:true,但是當我從服務器運行視頻時,它看起來像不會緩衝。當它在本地加載視頻時很好。

var player = $f("player", {   
     src: "http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf", 
     version: [9, 115], 
     onFail: function() { 
      document.getElementById("info").innerHTML = 
        "You need the latest Flash version to see MP4 movies. " + 
         "Your version is " + this.getVersion(); 
     } 
    }, { 
     clip: { 
      url:"http://path/Videos/04. The White Shirt.mp4 
      autoBuffering: true, 
      bufferLength : 2, autoPlay: true, 
     } 
    }); 
+0

當我在服務器上運行mp4文件時,我沒有任何問題。我懷疑它可能與你的服務器有關,但如果你可以提供你的服務器的mp4文件的鏈接,那麼這將更容易檢查。 此外,您已將自動播放設置爲true,這將導致自動緩衝區無論其設置如何都爲true。 –

回答

0

正如指出here,也許用的編碼類型的MP4的問題:

對於MP4文件,你必須從文件末尾移動MP4元數據(「MOOV原子」)到開始

編輯:我剛剛測試過qt-faststart(與Debian中的ffmpeg一起打包):像魅力一樣工作!只需將您的視頻編碼爲MP4,然後運行:

qt-faststart encoded-video.mp4 encoded-for-streaming-video.mp4 

大小完全相同,但視頻立即播放。