fix error

This commit is contained in:
邱博亞 2022-01-01 11:22:47 +08:00
parent 65c9baeed3
commit 8e387dc35c
1 changed files with 11 additions and 2 deletions

View File

@ -259,9 +259,14 @@
var cyclediv = $(this).parents("div.cycle-slideshow").eq(0);
if(!is_frontend || (is_frontend && cyclediv.find('[data-autoplay=1]').length != 0)){
cyclediv.cycle("pause").cycle("next");
var current_cycle = cyclediv.find(".cycle-slide-active")
if(current_cycle.hasClass("jplayer_slide"))
var current_cycle = cyclediv.find(".cycle-slide-active");
if(current_cycle.hasClass("jplayer_slide")){
var $video_ele = current_cycle.find('.jp-jplayer video');
if ($video_ele.length>0){
$video_ele.eq(0).attr('autoplay','autoplay').attr('muted','muted').attr('playsinline',true);
}
current_cycle.find('.jp-jplayer').jPlayer("mute", true).jPlayer("play",0);
}
else if(current_cycle.find('iframe').length>0){
current_cycle.find('iframe').data("yt_player").mute().playVideo();
}
@ -347,6 +352,10 @@
$(this).jPlayer("setMedia", jPlayer_<%= i %>_data);
if ($(this).parents(".ba-banner-widget-youtube").eq(0).find(".w-ba-banner__slide").index($(this).parents(".w-ba-banner__slide").eq(0))==0){
<% if @autoplay_video == true %>
var $video_ele = $(this).find('video');
if ($video_ele.length>0){
$video_ele.eq(0).attr('autoplay','autoplay').attr('muted','muted').attr('playsinline',true);
}
$(this).jPlayer("mute", true).jPlayer("play",0);
<% end %>
}