Skip to content

Commit

Permalink
Fixed audio is not paused on click of next and prev button
Browse files Browse the repository at this point in the history
  • Loading branch information
iam-pranav committed Jan 9, 2024
1 parent 874d67f commit 49fedd6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions js/qsm-quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,7 @@ function qmnInitPagination(quiz_id) {
jQuery(document).on('qsm_next_button_click_after qsm_previous_button_click_after', function(event, quiz_id) {
let video_sections = jQuery(`.qsm-quiz-container-${quiz_id}.qmn_quiz_container`).find('video');
let iframeVideos = jQuery(`.qsm-quiz-container-${quiz_id}.qmn_quiz_container`).find('iframe');
let audio_sections = jQuery(`.qsm-quiz-container-${quiz_id}.qmn_quiz_container`).find('audio');
iframeVideos.each(function() {
let src = this.src;
jQuery(this).attr('src', src);
Expand All @@ -1343,6 +1344,11 @@ jQuery(document).on('qsm_next_button_click_after qsm_previous_button_click_after
this.pause();
}
});
audio_sections.each(function() {
if (!this.paused) {
this.pause();
}
});
});
function qmnSocialShare(network, mlw_qmn_social_text, mlw_qmn_title, facebook_id, share_url) {
var sTop = window.screen.height / 2 - (218);
Expand Down

0 comments on commit 49fedd6

Please sign in to comment.