mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
22 lines
No EOL
717 B
JavaScript
22 lines
No EOL
717 B
JavaScript
var sourcesForAdsInterval = setInterval(function(){
|
|
setSourcesForAds();
|
|
},200);
|
|
|
|
function setSourcesForAds(){
|
|
if(typeof player ==='undefined'){
|
|
return false;
|
|
}
|
|
if(typeof player.currentSources !== 'function'){
|
|
if(typeof player.currentSources === 'object'){
|
|
console.log('currentSources changed to function');
|
|
var sourcesForAds = player.currentSources;
|
|
player.currentSources = function(){return sourcesForAds;};
|
|
console.log('currentSources', player.currentSources);
|
|
}
|
|
}else{
|
|
clearTimeout(sourcesForAdsInterval);
|
|
setTimeout(function(){
|
|
setSourcesForAds();
|
|
},1000);
|
|
}
|
|
} |