diff --git a/erpnext/setup/page/welcome_to_erpnext/welcome_to_erpnext.js b/erpnext/setup/page/welcome_to_erpnext/welcome_to_erpnext.js index 2af40a6a20..f072b8d8c5 100644 --- a/erpnext/setup/page/welcome_to_erpnext/welcome_to_erpnext.js +++ b/erpnext/setup/page/welcome_to_erpnext/welcome_to_erpnext.js @@ -4,7 +4,17 @@ frappe.pages['welcome-to-erpnext'].on_page_load = function(wrapper) { parent.html(frappe.render_template("welcome_to_erpnext", {})); parent.find(".video-placeholder").on("click", function() { + window.erpnext_welcome_video_started = true; parent.find(".video-placeholder").addClass("hidden"); - parent.find(".embed-responsive").append('') + parent.find(".embed-responsive").append('') + }); + + // pause video on page change + $(document).on("page-change", function() { + if (window.erpnext_welcome_video_started && parent) { + parent.find(".video-playlist").each(function() { + this.contentWindow.postMessage('{"event":"command","func":"' + 'pauseVideo' + '","args":""}', '*'); + }); + } }); }