From ec0dfbc25c45c2558452355056f0a1e41e662039 Mon Sep 17 00:00:00 2001 From: Bohung Date: Fri, 4 Mar 2022 15:51:03 +0800 Subject: [PATCH] Fix yt player bug. --- modules/ad_banner/_ad_banner_widget2_video.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ad_banner/_ad_banner_widget2_video.html.erb b/modules/ad_banner/_ad_banner_widget2_video.html.erb index c18fa06..746218b 100644 --- a/modules/ad_banner/_ad_banner_widget2_video.html.erb +++ b/modules/ad_banner/_ad_banner_widget2_video.html.erb @@ -131,7 +131,9 @@ if (typeof onYouTubeIframeAPIReady !== 'function'){ var banner_wrap = $(iframe).parents('.w-ba-banner__wrap').eq(0); banner_wrap.height(height).css({"padding-bottom":"","padding-top":""}); banner_wrap.find(".cycle-carousel-wrap").css("top","3em"); - delete (event.target.B || event.target.H).onStateChange; + try{ + delete (event.target.B || event.target.H || event.target.I).onStateChange; + }catch(e){console.log("{onReady: true, onStateChange: true} missing!")}; var onStateChange_idx = event.target.l.i.onStateChange; onStateChange_idx.reverse(); var event_size = 3;