Bug 530654 - Full-screen video closes immediately on OS X. r=gavin
authorDão Gottwald <dao@mozilla.com>
Thu, 26 Nov 2009 07:36:17 +0100
changeset 35243 f49658bb165584c1247c297d62e729c1cc92bab3
parent 35242 270a70535807c45277659d18d60e1d744b51ebd3
child 35244 157ea3970b73a4930d904d4d33fa469094330481
push idunknown
push userunknown
push dateunknown
reviewersgavin
bugs530654
milestone1.9.3a1pre
Bug 530654 - Full-screen video closes immediately on OS X. r=gavin
browser/base/content/fullscreen-video.xhtml
--- a/browser/base/content/fullscreen-video.xhtml
+++ b/browser/base/content/fullscreen-video.xhtml
@@ -78,16 +78,20 @@ try {
 } catch (e) {}
 document.title = title;
 
 window.addEventListener("focus", function () {
   window.removeEventListener("focus", arguments.callee, false);
 
   window.fullScreen = true;
 
+  window.addEventListener("deactivate", function () {
+    window.close();
+  }, false);
+
   video = document.querySelector("video");
 
   video.addEventListener("loadeddata", function () {
     video.removeEventListener("loadeddata", arguments.callee, false);
     video.volume = contentVideo.volume;
     video.muted = contentVideo.muted;
     video.poster = contentVideo.poster;
 
@@ -133,20 +137,16 @@ window.addEventListener("unload", functi
     contentVideo.muted = video.muted;
     if (!video.paused && !video.ended) {
       video.pause();
       contentVideo.play();
     }
   }
 }, false);
 
-window.addEventListener("deactivate", function () {
-  window.close();
-}, false);
-
 window.addEventListener("keypress", function (event) {
   if (event.keyCode == event.DOM_VK_ESCAPE) {
     window.close();
     return;
   }
 
   resetIdleTimer();