现在我正在使用jwplayer,当我加载我的视频时,它给我一个错误,例如“找不到可播放的源代码”,这是我的代码
<html>
<head>
<script type="text/javascript" src='http://content.jwplatform.com/libraries/DkwOvSfA.js'></script>
</head>
<body>
<div id="container">Loading the player...</div>
<script>
var playerInstance = jwplayer('container');
playerInstance.setup({
file: 'https://testvideoout.s3.amazonaws.com/Videos/Streaming/mp4_Videos_29_1446555606635',
image: "https://testvideoout.s3.amazonaws.com/Videos/Thumb/Thumb_Videos_29_1446555606635_00001.png",
primary: 'flash',
advertising: {
client: 'vast',
//tag: 'http://demo.jwplayer.com/static-tag/preroll.xml',
schedule: {
adbreak1: {
offset: "pre",
tag: 'http://demo.jwplayer.com/static-tag/preroll.xml'
},
adbreak2: {
offset: 5,
tag: 'http://demo.jwplayer.com/static-tag/preroll.xml',
//type: 'nonlinear'
},
adbreak3: {
offset: 20,
tag: 'http://demo.jwplayer.com/static-tag/preroll.xml',
//type: 'nonlinear'
},
adbreak4: {
offset: 80,
tag: 'http://demo.jwplayer.com/static-tag/preroll.xml',
//type: 'nonlinear'
},
adbreak5: {
offset: "post",
tag: 'http://demo.jwplayer.com/static-tag/preroll.xml'
},
}
}
});
</script>
</body>
</html>
你可以检查文件和图像两者是否正在工作仍然是给我错误,谁能告诉我什么是问题?我努力解决这个问题仍然没有成功
答案 0 :(得分:1)
JWPlayer存在没有文件扩展名的问题,因此您必须添加type
变量(在这种情况下,我会说它是type: "mp4"
:
var playerInstance = jwplayer('container');
playerInstance.setup({
file: 'https://testvideoout.s3.amazonaws.com/Videos/Streaming/mp4_Videos_29_1446555606635',
type: "mp4",
...
...