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);
|
||||
console.log('reloadAds');
|
||||
if (player && player.ima) {
|
||||
setTimeout(function () {
|
||||
reloadAdsIfIsReady();
|
||||
}, 1000);
|
||||
|
||||
} else {
|
||||
_reloadAdsTimeout = setTimeout(function () {
|
||||
reloadAds();
|
||||
|
@ -262,10 +261,14 @@ function reloadAdsIfIsReady() {
|
|||
adTagUrl = player.ima.getAdsManager().M;
|
||||
}
|
||||
console.log('reloadAdsIfIsReady change to ', _adTagUrl);
|
||||
setTimeout(function () {
|
||||
//player.ima.setContentWithAdTag(null, adTagUrl, true);
|
||||
player.ima.changeAdTag(adTagUrl);
|
||||
player.ima.initializeAdDisplayContainer();
|
||||
}, 500);
|
||||
setTimeout(function () {
|
||||
//player.ima.initializeAdDisplayContainer();
|
||||
player.ima.requestAds();
|
||||
}, 1000);
|
||||
} catch (e) {
|
||||
console.log('reloadAdsIfIsReady ERROR', e.message);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue