1
0
Fork 0
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:
DanielnetoDotCom 2021-03-03 18:51:22 -03:00
parent b405e10485
commit d3a467e15f

View file

@ -240,8 +240,6 @@ function reloadAds() {
clearTimeout(_reloadAdsTimeout);
console.log('reloadAds');
if (player && player.ima) {
console.log('reloadAdsIfIsReady change to ', _adTagUrl);
player.ima.changeAdTag(_adTagUrl);
reloadAdsIfIsReady();
} else {
_reloadAdsTimeout = setTimeout(function () {
@ -255,6 +253,10 @@ function reloadAdsIfIsReady() {
console.log('reloadAdsIfIsReady player.readyState() = ' + player.readyState());
if (!player.paused()) {
try {
setTimeout(function () {
console.log('reloadAdsIfIsReady change to ', _adTagUrl);
player.ima.changeAdTag(_adTagUrl);
}, 500);
setTimeout(function () {
//player.ima.initializeAdDisplayContainer();
player.ima.requestAds();