fix error

This commit is contained in:
邱博亞 2021-11-14 13:12:33 +08:00
parent ca6bb7a6f9
commit 4bea142d2a
2 changed files with 26 additions and 5 deletions

View File

@ -178,16 +178,12 @@
var jpalyer_video = $(ele).parents('.jp-video').eq(0);
jpalyer_video.find(".jp-gui").css("display","");
jpalyer_video.addClass('hide-ui');
<% if @hide_video_tools %>
ad_audio_button(ele,false);
<% end %>
}
function show_jplayer_ui_<%= i %>(ele) {
<% unless @hide_video_tools %>
var jpalyer_video = $(ele).parents('.jp-video').eq(0);
jpalyer_video.removeClass('hide-ui');
<% end %>
ad_audio_button(ele,true);
}
function click_jplayer_<%= i %>(){
$("#jp_container_<%= i %> .jp-video-play").css('display','')
@ -232,6 +228,9 @@
play_<%= i %>_flag = true;
ad_call_on_play_jplayer_<%= i %>(this);
jplayer_center_video_front($(this).find('video'));
<% if @hide_video_tools %>
ad_audio_button(ele,false);
<% end %>
},
click: function(){
click_jplayer_<%= i %>();
@ -241,6 +240,7 @@
$(this).jPlayer("pause");
ad_call_on_pause_jplayer_<%= i %>(this);
window.console.log("pause");
ad_audio_button(ele,true);
},
abort: function(){
play_<%= i %>_flag = false;

View File

@ -41,7 +41,28 @@
if (is_stop){
$(ele).find('.jarallax-video-audio').remove();
}else{
$(ele).append('<div class="jarallax-video-audio"><i class="fas fa-volume-mute"></i></div>');
var audio_div;
if ($(ele).hasClass('have-audio')){
audio_div = $('<div class="jarallax-video-audio"><i class="fas fa-volume-up"></i></div>');
}else{
audio_div = $('<div class="jarallax-video-audio"><i class="fas fa-volume-mute"></i></div>');
}
audio_div.click(function(){
var $video = $(ele).find('video');
if ($(ele).hasClass('have-audio')){
$(ele).removeClass('have-audio');
$(this).find('i.fas').attr('class','fas fa-volume-mute');
}else{
$(ele).addClass('have-audio');
$(this).find('i.fas').attr('class','fas fa-volume-up');
}
if ($video.length>0){
$video[0].muted = !$video[0].muted;
}else{//youtube
}
})
$(ele).append(audio_div);
}
}
if(document.getElementById("youtube-iframe-api") == null){