diff --git a/app/controllers/ad_banners_controller.rb b/app/controllers/ad_banners_controller.rb
index 470c856..5abf508 100644
--- a/app/controllers/ad_banners_controller.rb
+++ b/app/controllers/ad_banners_controller.rb
@@ -100,8 +100,9 @@ class AdBannersController < ApplicationController
>
#{ad_b.title}
diff --git a/modules/ad_banner/_ad_banner_widget2_video.html.erb b/modules/ad_banner/_ad_banner_widget2_video.html.erb
index 4f1468b..725db51 100644
--- a/modules/ad_banner/_ad_banner_widget2_video.html.erb
+++ b/modules/ad_banner/_ad_banner_widget2_video.html.erb
@@ -68,15 +68,21 @@ if (typeof onYouTubeIframeAPIReady !== 'function'){
}
function onPlayerStateChange(event){
- var iframe = $(event.target.getIframe()),
+ var iframe = $(event.target.h),
cyclediv = iframe.parents("div.cycle-slideshow");
+ var widget = cyclediv.parents('.ba-banner-widget-youtube')
if(event.data == YT.PlayerState.PLAYING || event.data == YT.PlayerState.BUFFERING){
cyclediv.cycle("pause");
+ widget.find('.banner-pager,.controlplay,.button-mid,.ad-overlay').css('visibility','hidden')
}else if(event.data == YT.PlayerState.PAUSED || event.data == YT.PlayerState.ENDED){
cyclediv.cycle("resume");
+ widget.find('.banner-pager,.controlplay,.button-mid,.ad-overlay').css('visibility','')
}
}
$(document).ready(function(){
+ window.onYouTubePlayerAPIReady = function() {
+ onYouTubeIframeAPIReady();
+ };
$('.pause-slide').off('click').click(function(){
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle('pause');
$(this).addClass('active')