fix error

This commit is contained in:
邱博亞 2021-11-15 12:50:02 +08:00
parent 17a48a3b1a
commit 3b2f22159e
1 changed files with 10 additions and 9 deletions

View File

@ -38,32 +38,33 @@
var ad_banners_count = 0; var ad_banners_count = 0;
} }
function ad_audio_button(ele,is_stop){ function ad_audio_button(ele,is_stop){
var $self = $(ele);
if (is_stop){ if (is_stop){
$(ele).find('.jarallax-video-audio').remove(); $self.find('.jarallax-video-audio').remove();
}else{ }else{
var audio_div; var audio_div;
if ($(ele).hasClass('have-audio')){ if ($self.hasClass('have-audio')){
audio_div = $('<div class="jarallax-video-audio"><i class="fas fa-volume-up"></i></div>'); audio_div = $('<div class="jarallax-video-audio"><i class="fas fa-volume-up"></i></div>');
}else{ }else{
audio_div = $('<div class="jarallax-video-audio"><i class="fas fa-volume-mute"></i></div>'); audio_div = $('<div class="jarallax-video-audio"><i class="fas fa-volume-mute"></i></div>');
} }
audio_div.click(function(event){ audio_div.click(function(event){
event.stopPropagation(); event.stopPropagation();
var $video = $(ele).find('video'); var $video = $self.find('video');
if ($(ele).hasClass('have-audio')){ if ($self.hasClass('have-audio')){
$(ele).removeClass('have-audio'); $self.removeClass('have-audio');
$(this).find('i.fas').attr('class','fas fa-volume-mute'); $(this).find('i.fas').attr('class','fas fa-volume-mute');
}else{ }else{
$(ele).addClass('have-audio'); $self.addClass('have-audio');
$(this).find('i.fas').attr('class','fas fa-volume-up'); $(this).find('i.fas').attr('class','fas fa-volume-up');
} }
if ($video.length>0){ if ($video.length>0){
$(ele).jPlayer("mute", !$(ele).data().jPlayer.options.muted); $self.jPlayer("mute", !$self.data().jPlayer.options.muted);
}else{//youtube }else{//youtube
$(ele).find('iframe').data("yt_player").unmute(); $self.find('iframe').data("yt_player").unmute();
} }
}) })
$(ele).append(audio_div); $self.append(audio_div);
} }
} }
if(document.getElementById("youtube-iframe-api") == null){ if(document.getElementById("youtube-iframe-api") == null){