diff --git a/twu_moodle_course.js b/twu_moodle_course.js index 88c1e49..826bd25 100644 --- a/twu_moodle_course.js +++ b/twu_moodle_course.js @@ -1,6 +1,11 @@ $(document).ready(function () { $("select").change(function () { $(this).find("option:selected").each(function () { + const iframes = document.querySelectorAll("iframe"); + iframes.forEach((videoframe) => { + const iframePlayer = new Vimeo.Player(videoframe); + iframePlayer.pause(); + }); var optionValue = $(this).attr("value"); if (optionValue) { $(".toggle-box").not("." + optionValue).hide();