mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 03:50:04 +02:00
Fix ads on playlists
This commit is contained in:
parent
cd51622b15
commit
5c033ce1e2
1 changed files with 5 additions and 4 deletions
|
@ -238,22 +238,23 @@ function changeVideoSrcLoad() {
|
|||
var _reloadAdsTimeout;
|
||||
function reloadAds() {
|
||||
clearTimeout(_reloadAdsTimeout);
|
||||
console.log('reloadAds');
|
||||
console.log('reloadAds ');
|
||||
if (playerIsReady() && player.ima) {
|
||||
try {
|
||||
setTimeout(function () {
|
||||
if (!player.ima.getAdsManager()) {
|
||||
console.log('reloadAdsIfIsReady 1 ');
|
||||
console.log('reloadAds 1 ');
|
||||
} else {
|
||||
console.log('reloadAdsIfIsReady 2 change to ', _adTagUrl);
|
||||
console.log('reloadAds 2 change to ', _adTagUrl);
|
||||
player.ima.changeAdTag(_adTagUrl);
|
||||
}
|
||||
setTimeout(function () {
|
||||
console.log('reloadAds ready state ', player.readyState());
|
||||
player.ima.requestAds();
|
||||
}, 1000);
|
||||
}, 1000);
|
||||
} catch (e) {
|
||||
console.log('reloadAdsIfIsReady ERROR', e.message);
|
||||
console.log('reloadAds ERROR', e.message);
|
||||
}
|
||||
} else {
|
||||
_reloadAdsTimeout = setTimeout(function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue