mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
Fix ads on playlists
This commit is contained in:
parent
5ce0e5b1e6
commit
c466840578
1 changed files with 10 additions and 7 deletions
|
@ -240,9 +240,8 @@ function reloadAds() {
|
||||||
clearTimeout(_reloadAdsTimeout);
|
clearTimeout(_reloadAdsTimeout);
|
||||||
console.log('reloadAds');
|
console.log('reloadAds');
|
||||||
if (player && player.ima) {
|
if (player && player.ima) {
|
||||||
setTimeout(function () {
|
reloadAdsIfIsReady();
|
||||||
reloadAdsIfIsReady();
|
|
||||||
}, 1000);
|
|
||||||
} else {
|
} else {
|
||||||
_reloadAdsTimeout = setTimeout(function () {
|
_reloadAdsTimeout = setTimeout(function () {
|
||||||
reloadAds();
|
reloadAds();
|
||||||
|
@ -262,10 +261,14 @@ function reloadAdsIfIsReady() {
|
||||||
adTagUrl = player.ima.getAdsManager().M;
|
adTagUrl = player.ima.getAdsManager().M;
|
||||||
}
|
}
|
||||||
console.log('reloadAdsIfIsReady change to ', _adTagUrl);
|
console.log('reloadAdsIfIsReady change to ', _adTagUrl);
|
||||||
//player.ima.setContentWithAdTag(null, adTagUrl, true);
|
setTimeout(function () {
|
||||||
player.ima.changeAdTag(adTagUrl);
|
//player.ima.setContentWithAdTag(null, adTagUrl, true);
|
||||||
player.ima.initializeAdDisplayContainer();
|
player.ima.changeAdTag(adTagUrl);
|
||||||
player.ima.requestAds();
|
}, 500);
|
||||||
|
setTimeout(function () {
|
||||||
|
//player.ima.initializeAdDisplayContainer();
|
||||||
|
player.ima.requestAds();
|
||||||
|
}, 1000);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('reloadAdsIfIsReady ERROR', e.message);
|
console.log('reloadAdsIfIsReady ERROR', e.message);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue