我希望jwplayer
在不播放广告的情况下加载新视频。
以下是我设置jwplayer
jwplayer("jwplayer_container").setup({
playlist: [{
image: "/images/covers/movie.jpg",
sources: [{
file: "rtmp://[wowza-ip]:1935/mediacache/_definst_/mp4:movie/movie.mp4", "default": true
}]
}],
primary: "flash",
fallback: false,
flashplayer: "/jwplayer.flash.swf",
html5player: "/jwplayer.html5.js",
width: "854",
height: "480",
advertising: {
client: "vast",
schedule: {
preroll: {
offset: "pre",
tag: "/api/get_video_ads.php?banner_id=9",
}
},
}});
当我使用jwplayer.load
时,它可以播放new_movie
,但我仍然可以在电影开始前看到jwplayer播放的预卷广告。
var new_movie = "rtmp://[wowza-ip]:1935/mediacache/_definst_/mp4:movie/new_movie.mp4
jwplayer("jwplayer_container").load([{file : new_movie}]);
你能帮我停止广告吗?
抱歉我的英文不好
答案 0 :(得分:0)
为什么不用新电影再次进行设置,而不是做广告。
所以你有正常的代码:
jwplayer("jwplayer_container").setup({
playlist: [{
image: "/images/covers/movie.jpg",
sources: [{
file: "rtmp://[wowza-ip]:1935/mediacache/_definst_/mp4:movie/movie.mp4", "default": true
}]
}],
primary: "flash",
fallback: false,
flashplayer: "/jwplayer.flash.swf",
html5player: "/jwplayer.html5.js",
width: "854",
height: "480",
advertising: {
client: "vast",
schedule: {
preroll: {
offset: "pre",
tag: "/api/get_video_ads.php?banner_id=9",
}
},
}});
所以不要使用这段代码:
var new_movie = "rtmp://[wowza-ip]:1935/mediacache/_definst_/mp4:movie/new_movie.mp4
jwplayer("jwplayer_container").load([{file : new_movie}]);
使用此:
var new_movie = "rtmp://[wowza-ip]:1935/mediacache/_definst_/mp4:movie/new_movie.mp4
这个设置代码:
jwplayer("jwplayer_container").setup({
playlist: [{
image: "/images/covers/movie.jpg",
sources: [{
file: new_movie, "default": true
}]
}],
primary: "flash",
fallback: false,
flashplayer: "/jwplayer.flash.swf",
html5player: "/jwplayer.html5.js",
width: "854",
height: "480"
}});
这应该可以解决问题。