而不是使用:
jwplayer("playerlive").playAd(tagurl);
爲什麼不使用廣告連播?
http://support.jwplayer.com/customer/portal/articles/1433722-ad-pods
示例設置代碼:
<div id="container"> </div>
</div>
</div>
<script>
jwplayer("container").setup({
image: "http://demo.jwplayer.com.s3.amazonaws.com/advertising/assets/adpod.jpg",
file: "http://content.jwplatform.com/videos/s8BPzDe0-kNspJqnJ.mp4",
width: 640,
height: 360,
advertising: {
client:"vast",
admessage:"This is an ad pod. This ad ends in xx seconds.",
schedule:{
adbreak1: {
offset:'pre',
tag: 'http://demo.jwplayer.com/advertising/assets/vast3_jw_ads.xml'
},
overlay: {
offset:'5',
tag: 'http://demo.jwplayer.com/advertising/assets/overlay.xml',
type:"nonlinear"
},
adbreak2: {
offset:'300',
tag: 'http://demo.jwplayer.com/advertising/assets/vast3_jw_ads.xml'
},
adbreak3: {
offset:'post',
tag: 'http://demo.jwplayer.com/advertising/assets/vast3_jw_ads.xml'
}
}
}
});
</script>
例如,看看廣告代碼的預卷 - http://demo.jwplayer.com/advertising/assets/vast3_jw_ads.xml
你可以把每一個廣闊的標籤到XML文件,所以他們都一起玩。
我不介意在廣告開始時和結束時的緩衝區屏幕。我只是想避免廣告之間的緩衝,以獲得無縫的體驗。 – vinit