Javascript Flowplayer自动播放播放列表,视频之间有延迟
有人知道如何在播放列表的每个片段末尾添加延迟吗。 我试着这样做:Javascript Flowplayer自动播放播放列表,视频之间有延迟,javascript,flowplayer,Javascript,Flowplayer,有人知道如何在播放列表的每个片段末尾添加延迟吗。 我试着这样做: flowplayer("a.flowplayer", {src: "/flowplayer2/dist/swf/flowplayer-3.2.7.swf",wmode: 'transparent'}, { clip: { onFinish: function(clip) { this.pause(); var obj = this; setT
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
}
}]
}
}
}
});
但它不工作,它只是在播放第一个视频后停止
谢谢,,
Dmitry我从未为Flowplayer使用过OVA插件,但从技术上讲,你的onFinish函数只是暂停播放器,然后再播放。然后到了剪辑的最后,我想它会停下来
如果你的播放器从OVA插件中得到播放列表(你可以通过调用<代码> $FE)检查.jgScript控制台,GETPrimeList[Audio](代码>,它返回一个剪辑数组),然后考虑改变你的OnFrand函数:
flowplayer("a.flowplayer", {src: "/flowplayer2/dist/swf/flowplayer-3.2.7.swf",wmode: 'transparent'}, {
clip: {
onFinish: function(clip) {
// First check where you are in your playlist
var currentClipIndex = this.getClip().index;
// Get length of playlist
var playlistLength = this.getPlaylist().length;
// save handle to player instance
var fp = this;
// check if there is a clip after the current (last clip has index "playlistLength -1")
if (currentClipIndex < playlistLength -1) {
setTimeout(function() {
// tell fp to play clip with next index
fp.play(currentClipIndex + 1);
// in five seconds
}, 5*1000)
}
},
},
{...}
});
flowplayer(“a.flowplayer,{src:”/flowplayer2/dist/swf/flowplayer-3.2.7.swf),wmode:'transparent'}{
剪辑:{
onFinish:函数(剪辑){
//首先检查您在播放列表中的位置
var currentClipIndex=this.getClip().index;
//获取播放列表的长度
var playlistength=此.getPlaylist().length;
//将句柄保存到播放器实例
var fp=这个;
//检查当前剪辑之后是否有剪辑(最后一个剪辑的索引为“playlinglength-1”)
如果(currentClipIndex<播放长度-1){
setTimeout(函数(){
//告诉fp播放带有下一个索引的剪辑
fp.播放(当前剪辑索引+1);
//五秒钟后
}, 5*1000)
}
},
},
{...}
});