mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 19:42:38 +02:00
Fix ads on playlists
This commit is contained in:
parent
b405e10485
commit
d3a467e15f
1 changed files with 4 additions and 2 deletions
|
@ -240,8 +240,6 @@ function reloadAds() {
|
||||||
clearTimeout(_reloadAdsTimeout);
|
clearTimeout(_reloadAdsTimeout);
|
||||||
console.log('reloadAds');
|
console.log('reloadAds');
|
||||||
if (player && player.ima) {
|
if (player && player.ima) {
|
||||||
console.log('reloadAdsIfIsReady change to ', _adTagUrl);
|
|
||||||
player.ima.changeAdTag(_adTagUrl);
|
|
||||||
reloadAdsIfIsReady();
|
reloadAdsIfIsReady();
|
||||||
} else {
|
} else {
|
||||||
_reloadAdsTimeout = setTimeout(function () {
|
_reloadAdsTimeout = setTimeout(function () {
|
||||||
|
@ -255,6 +253,10 @@ function reloadAdsIfIsReady() {
|
||||||
console.log('reloadAdsIfIsReady player.readyState() = ' + player.readyState());
|
console.log('reloadAdsIfIsReady player.readyState() = ' + player.readyState());
|
||||||
if (!player.paused()) {
|
if (!player.paused()) {
|
||||||
try {
|
try {
|
||||||
|
setTimeout(function () {
|
||||||
|
console.log('reloadAdsIfIsReady change to ', _adTagUrl);
|
||||||
|
player.ima.changeAdTag(_adTagUrl);
|
||||||
|
}, 500);
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
//player.ima.initializeAdDisplayContainer();
|
//player.ima.initializeAdDisplayContainer();
|
||||||
player.ima.requestAds();
|
player.ima.requestAds();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue