2012-08-06 12 views
2

我正在jwplayer中加載一個xml文件,以根據點擊哪個鏈接來播放視頻。下面是我jwplayer設置代碼,和xml:Jwplayer無法在html5模式下播放視頻,但在Flash模式下工作正常

Jwplayer:

<script type="text/javascript"> 
jwplayer("player-container").setup({ 
autostart: true, 
'modes': [ 
    {type: 'html5'}, 
    {type: 'flash', src: '/assets/components/mediaplayer-5.8/5.9/player.swf',config:{ 
     skin: "/assets/components/mediaplayer-5.8/modieus.swf"   
    }}, 
    {type: 'download'} 
    ],  
repeat: 'list', 
width: 480 
    }); 
    jwplayer().load('/media/narration.xml') 
</script> 

示例XML:

<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/"> 
    <channel> 
    <title>Sample File</title> 

<item> 
     <title>peking</title> 
     <link></link> 
     <description></description> 

     <pubDate>Sat, 07 Sep 2002 09:42:31 GMT</pubDate> 

     <media:content url="/videos/Peking Edit For Web-7.mp4" /> 
     <media:thumbnail url="/images/playerimg.jpg" /> 

</item> 

    </channel> 
</rss> 

然而,沒有視頻播放。但如果我帶{type: 'html5'}低於flash,視頻顯示正確。任何想法我可能做錯了什麼?

+0

把''和''放在''裏面有什麼區別嗎?我注意到他們將它用於[xml播放列表測試頁面]上的播放列表文件(http://developer.longtailvideo.com/player/trunk/fl5/js/test/examples/xmlplaylists.html)。 – merv 2012-08-06 13:23:06

+0

nope,同樣的錯誤 – Bluemagica 2012-08-07 06:45:00

回答

0

事實證明,只是因爲一個文件是mp4,它可能並不總是播放jwplayer。我必須用H264編碼才能讓它們正常播放。我使用了一個名爲「handbrake」的軟件。

0

JW PLayer嘗試按照指定的模式參數中指定的類型播放視頻。所以如果HTML5在Flash之前,它將首先嚐試在HTML5中播放。 HTML5使用標籤,所以試圖包裝聲明內的視頻標籤

相關問題