tomSkipAdButtonContainer').length > 0 && $('#adsTimer').length < 1 ) { var adTimerSecond = 10; if ( adVideoDuration < adTimerSecond ) { adTimerSecond = adVideoDuration - 1; } $('#customSkipAdButtonContainer').prepend('

' + adTimerSecond + '秒后可关闭该广告

'); var adTimerInterval = setInterval(function() { adTimerSecond = adTimerSecond - 1; $('#adsTimer').text(adTimerSecond + "秒后可关闭该广告"); if ( adTimerSecond == 0 ) { clearInterval(adTimerInterval); } }, 1000); } var videoPlayed = false; setTimeout(function(){ $('#adsTimer').remove(); if ( $('#customSkipAdButtonContainer').length > 0 ) { $('#customSkipAdButtonContainer').prepend('

关闭该广告

'); } $(document.body).on('click', '#customSkipAdButton' ,function(){ $('#customBufferContainer').remove(); // var videoSrc = $('#playleft iframe').attr('src'); // $('#playleft iframe').remove(); videoPlayed = true; $(".MacPlayer").prepend(''); }) }, adTimerSecond * 1000 ); setTimeout(function(){ $('#customBufferContainer').remove(); if ( !videoPlayed ) { // var videoSrc = $('#playleft iframe').attr('src'); // $('#playleft iframe').remove(); $(".MacPlayer").prepend(''); } }, (adVideoDuration) * 1000 ); } }, 1000 ); }