From 49fedd68e35429a13ee0c87374e9f527c9d44d18 Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Tue, 9 Jan 2024 16:53:41 +0530 Subject: [PATCH] Fixed audio is not paused on click of next and prev button --- js/qsm-quiz.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index 7d7ee9796..c378204a3 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -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); @@ -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);