我收到"加载播放列表时出错:加载文件时出错"
html页面......
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="/Players/jwplayer6.8.js"></script>
<script src="/Players/jwplayer.html5.js"></script>
</head>
<body>
<div id="divPlayer"></div>
<script type="text/javascript">
jwplayer('divPlayer').setup({
playlist: 'http://media.howdoyouguru.com/guru/130438044361506556/2c4f8cc1-6142-441a-85e3-393f8614d4b3.xml',
width: 640,
height: 380
})
</script>
</body>
</html>
rss文件......
<rss xmlns:media="http://search.yahoo.com/mrss/" xmlns:jwplayer="http://developer.longtailvideo.com/trac/wiki/FlashFormats" version="2.0">
<channel>
<title>GURU Online Playlist</title>
<item>
<title>Custom Audio 10 seconds past Video</title>
<jwplayer:source file="http://media.howdoyouguru.com/guru/130438044361506556/ab66f56f-f43c-4a7e-b858-9c616c592044.mp4"/>
<jwplayer:image url="http://media.howdoyouguru.com/guru/130438044361506556/52e36daf-b731-4607-bead-24354bd851c8.jpg"/>
</item>
</channel>
</rss>
我已经去了每个文件以确保它存在,如果输入文件的url,则会播放mp4文件。
网址为test.howdoyouguru.com/test.html
感谢您的帮助。 加里
答案 0 :(得分:1)
您的链接test.howdoyouguru.com/test.html有效。 当尝试加载xml文件时,此错误会阻止jwplayer加载xml文件
XMLHttpRequest cannot load http://media.howdoyouguru.com/guru/130438044361506556/2c4f8cc1-6142-441a-85e3-393f8614d4b3.xml.
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://test.howdoyouguru.com' is therefore not allowed access.
将Access-Control-Allow-Origin标头添加到xml然后它将起作用
修改强>
如何启用CORS