diff options
Diffstat (limited to 'init.js')
-rw-r--r-- | init.js | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,14 +1,14 @@ require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) { ready(function () { - Event.observe(window, "focus", function() { - $$("video").forEach((vid) => { + window.addEventListener("focus", function() { + App.findAll("video").forEach((vid) => { if (vid.getAttribute("autoplay") == 1 && vid.paused) vid.play(); }) }); - Event.observe(window, "blur", function() { - $$("video").forEach((vid) => { + window.addEventListener("blur", function() { + App.findAll("video").forEach((vid) => { if (vid.getAttribute("autoplay") == 1 && !vid.paused) vid.pause(); }) |