IMA 広告を配信したいのですが、エラーで VAST に「ウォーターフォール」します。それは可能ですか?
私の知る限り、jwplayer を初期化するときにクライアント (「vast」または「googima」) を設定する必要があるため、「onAdError」イベントでクライアントを変更することはできません。
「onAdError」イベントでクライアントを設定するオプションはありますか?
これは私がやろうとしていることです:
var aAds = [ {
client: "vast",
tag: "http://foo.com/vast.xml"
}, {
client: "googima",
tag: "http://foo.com/ima.xml"
}];
jwplayer("container1").setup({
image: "http://foo.com/bar.png",
file: "http://foo.com/bar.mp4",
advertising: {
client: "vast" // This is mandatory, isn't it?
}
});
var iAd = 0;
function showNextAdd( onPlay ) {
if (onPlay && iAd > 0) return;
if (iAd < aAds.length) {
jwplayer().playAd( aAds[iAd++].tag );
}
}
// Try first add on start
jwplayer().onPlay( function(){
showNextAdd(true);
});
// If error try next
jwplayer().onAdError( showNextAdd );