fix error

This commit is contained in:
邱博亞 2021-11-15 14:35:20 +08:00
parent 24bf89a3a8
commit c05bf41151
1 changed files with 15 additions and 15 deletions

View File

@ -50,6 +50,19 @@
} }
audio_div.click(function(event) { audio_div.click(function(event) {
event.stopPropagation(); event.stopPropagation();
var $video = $self.find('video');
if ($self.hasClass('have-audio')){
$self.removeClass('have-audio');
$(this).find('i.fas').attr('class','fas fa-volume-mute');
}else{
$self.addClass('have-audio');
$(this).find('i.fas').attr('class','fas fa-volume-up');
}
if ($video.length>0){
$self.jPlayer("mute", !$self.data().jPlayer.options.muted);
}else{//youtube
$self.find('iframe').data("yt_player").unmute();
}
}); });
$self.append(audio_div); $self.append(audio_div);
} }
@ -68,21 +81,8 @@
ad_banners_count++; ad_banners_count++;
}) })
if (typeof onYouTubeIframeAPIReady !== 'function'){ if (typeof onYouTubeIframeAPIReady !== 'function'){
$(document).on('click touchstart',".jarallax-video-audio",function(event){ $(document).on('touchstart',".jarallax-video-audio",function(event){
var $self = $(this).parent(); $(this).trigger('click');
var $video = $self.find('video');
if ($self.hasClass('have-audio')){
$self.removeClass('have-audio');
$(this).find('i.fas').attr('class','fas fa-volume-mute');
}else{
$self.addClass('have-audio');
$(this).find('i.fas').attr('class','fas fa-volume-up');
}
if ($video.length>0){
$self.jPlayer("mute", !$self.data().jPlayer.options.muted);
}else{//youtube
$self.find('iframe').data("yt_player").unmute();
}
}); });
if(window.yt_players == undefined) if(window.yt_players == undefined)
window.yt_players = {}; window.yt_players = {};