Flowplayer 自动播放播放列表,视频之间有延迟
有谁知道如何在播放列表的每个剪辑的末尾添加延迟。 我正在尝试这样的事情:
flowplayer("a.flowplayer", {src: "/flowplayer2/dist/swf/flowplayer-3.2.7.swf",wmode: 'transparent'}, {
clip: {
onFinish: function(clip) {
this.pause();
var obj = this;
setTimeout(function(){
obj.play()
},5*1000);
},
},
plugins: {
controls: {
autoHide: "always"
},
ova: {
url: '/flowplayer2/dist/swf/d/ova.swf',
"autoPlay" : true,
"autoBuffering": true,
"shows": {
"streams": [
{ "file":"one.flv"},
{ "file":"two.flv"},
{ "file":"three.flv"}
]
},
"ads": {
"pauseOnClickThrough": true,
"displayCompanions": true,
"restoreCompanions": false,
"companions": [{
"id":"lcBannerDiv",
"width":"300",
"height":"250",
"resourceType": "iframe"
}],
"notice": { show: false },
"schedule": [{
"position": "pre-roll",
"server": {
"type": "direct",
"tag": VAST_URL
}
}]
}
}
}
});
但它不起作用,它在播放第一个视频后就停止了。
谢谢你, 德米特里
Does anyone know how to add delay at the end of each clip of playlist.
I was trying something like this:
flowplayer("a.flowplayer", {src: "/flowplayer2/dist/swf/flowplayer-3.2.7.swf",wmode: 'transparent'}, {
clip: {
onFinish: function(clip) {
this.pause();
var obj = this;
setTimeout(function(){
obj.play()
},5*1000);
},
},
plugins: {
controls: {
autoHide: "always"
},
ova: {
url: '/flowplayer2/dist/swf/d/ova.swf',
"autoPlay" : true,
"autoBuffering": true,
"shows": {
"streams": [
{ "file":"one.flv"},
{ "file":"two.flv"},
{ "file":"three.flv"}
]
},
"ads": {
"pauseOnClickThrough": true,
"displayCompanions": true,
"restoreCompanions": false,
"companions": [{
"id":"lcBannerDiv",
"width":"300",
"height":"250",
"resourceType": "iframe"
}],
"notice": { show: false },
"schedule": [{
"position": "pre-roll",
"server": {
"type": "direct",
"tag": VAST_URL
}
}]
}
}
}
});
but it doesn't work, it just stops after playing first video.
Thank you,
Dmitry
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我从未使用过 Flowplayer 的 OVA 插件,但从技术上讲,您的 onFinish 函数只是暂停播放器,然后再次播放。我想,然后它会转到剪辑的末尾并停止。
如果您的播放器从 OVA 插件获得了播放列表(您可以通过调用
$f().getPlaylist()
在 JavaScript 控制台上检查此内容,它会返回剪辑数组),然后考虑更改您的 onFinish 函数,例如这:I never used OVA plugin for Flowplayer, but technically your onFinish function just pauses the player and after that it plays again. Then it goes to the end of the clip and stops, I think.
If your player got a playlist from OVA plugin (you can check this on JavaScript console via calling
$f().getPlaylist()
, it returns an array of clips), then consider changing your onFinish function like this: