2

I am loading an xml file in jwplayer to play videos depending on which link is clicked. Below is my jwplayer setup code, and xml:

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>

Sample 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>

However, no video is playing. But if I bring {type: 'html5'} below flash, videos show up correctly. Any idea what I might be doing wrong?

4

2 回答 2

0

JW 播放器尝试根据 mode 参数中指定的类型,按照指定的顺序播放视频。所以如果 HTML5 在 Flash 之前,它会先尝试在 HTML5 中播放。HTML5 使用该标签,因此请尝试将语句包装在视频标签内

于 2012-09-03T20:41:55.893 回答
0

事实证明,仅仅因为一个文件是 mp4,它可能并不总是在 jwplayer 中播放。我必须用 H264 对其进行编码才能让它们正常播放。为此,我使用了一个名为“手刹”的软件。

于 2012-09-05T12:53:28.563 回答