我正在 jwplayer 中加载一个 xml 文件,以根据单击的链接播放视频。下面是我的 jwplayer 设置代码和 xml:
Jw播放器:
<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
下方,视频就会正确显示。知道我可能做错了什么吗?
最佳答案
JW PLayer 尝试根据模式参数中指定的类型,按照指定的顺序播放视频。所以如果 HTML5 在 Flash 之前,它会先尝试在 HTML5 中播放。 HTML5 使用标签,所以尝试将语句包装在视频标签中
关于jquery - Jwplayer在html5模式下无法播放视频,但在flash模式下可以正常播放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11827270/