fix error
This commit is contained in:
parent
1fb9190bee
commit
0cdff73a4f
|
@ -158,8 +158,22 @@ class AdBannersController < ApplicationController
|
||||||
"desc" => adbanner.title,
|
"desc" => adbanner.title,
|
||||||
"extra_brefore_html" => extra_before_html,
|
"extra_brefore_html" => extra_before_html,
|
||||||
"extra_after_html" => extra_after_html,
|
"extra_after_html" => extra_after_html,
|
||||||
"extra_ready_script" => "if(i == 0 && banner_wrap.find('[data-autoplay=1]').length != 0) event.target.mute().playVideo();",
|
"extra_ready_script" => "if(i == 0 && banner_wrap.find('.w-ad-banner__slide').index($(iframe).parents('.w-ad-banner__slide').eq(0))==0 && banner_wrap.find('[data-autoplay=1]').length != 0){
|
||||||
"extra_state_chnage_script" => "if(cyclediv.find('[data-autoplay=1]').length != 0){if(event.data == YT.PlayerState.ENDED){ var current_cycle; cyclediv.cycle(\"pause\") && cyclediv.cycle(\"next\") && (current_cycle=cyclediv.find(\".cycle-slide-active\"), (current_cycle.hasClass(\"jplayer_slide\") ? current_cycle.find('.jp-jplayer').jPlayer(\"mute\", true).jPlayer(\"play\",0) : current_cycle.find('iframe').data(\"yt_player\").mute().playVideo()));}}",
|
event.target.mute().playVideo();
|
||||||
|
}",
|
||||||
|
"extra_state_chnage_script" => "if(cyclediv.find('[data-autoplay=1]').length != 0){
|
||||||
|
if(event.data == YT.PlayerState.ENDED){
|
||||||
|
var current_cycle;
|
||||||
|
cyclediv.cycle(\"pause\");
|
||||||
|
cyclediv.cycle(\"next\");
|
||||||
|
current_cycle = cyclediv.find(\".cycle-slide-active\");
|
||||||
|
if (current_cycle.hasClass(\"jplayer_slide\"){
|
||||||
|
current_cycle.find('.jp-jplayer').jPlayer(\"mute\", true).jPlayer(\"play\",0);
|
||||||
|
}else{
|
||||||
|
current_cycle.find('iframe').data(\"yt_player\").mute().playVideo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}",
|
||||||
"extra_document_ready_script" => ((@autoplay_video == "1") ? "opts.API.pause() && opts.API.jump(0);" : "")
|
"extra_document_ready_script" => ((@autoplay_video == "1") ? "opts.API.pause() && opts.API.jump(0);" : "")
|
||||||
},
|
},
|
||||||
"images" => images
|
"images" => images
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
}
|
}
|
||||||
function ad_audio_button(ele,is_stop){
|
function ad_audio_button(ele,is_stop){
|
||||||
var $self = $(ele);
|
var $self = $(ele);
|
||||||
|
var button_container = $self.parents('.ba-banner-widget-youtube').eq(0);
|
||||||
if (is_stop){
|
if (is_stop){
|
||||||
$self.find('.jarallax-video-audio').remove();
|
$self.find('.jarallax-video-audio').remove();
|
||||||
}else{
|
}else{
|
||||||
|
@ -76,7 +77,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$self.append(audio_div);
|
button_container.find('.jarallax-video-audio').remove();
|
||||||
|
button_container.append(audio_div);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(document.getElementById("youtube-iframe-api") == null){
|
if(document.getElementById("youtube-iframe-api") == null){
|
||||||
|
@ -126,7 +128,7 @@ if (typeof onYouTubeIframeAPIReady !== 'function'){
|
||||||
events: {
|
events: {
|
||||||
'onReady': function(event){
|
'onReady': function(event){
|
||||||
var height = $(event.target.getIframe()).height();
|
var height = $(event.target.getIframe()).height();
|
||||||
var banner_wrap = $(".w-ba-banner__wrap[data-overlay=\".w-ad-banner__overlay_"+id+"\"]");
|
var banner_wrap = $(iframe).parents('.w-ba-banner__wrap').eq(0);
|
||||||
banner_wrap.height(height).css({"padding-bottom":"","padding-top":""});
|
banner_wrap.height(height).css({"padding-bottom":"","padding-top":""});
|
||||||
banner_wrap.find(".cycle-carousel-wrap").css("top","3em");
|
banner_wrap.find(".cycle-carousel-wrap").css("top","3em");
|
||||||
delete (event.target.B || event.target.H).onStateChange;
|
delete (event.target.B || event.target.H).onStateChange;
|
||||||
|
|
Loading…
Reference in New Issue