DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (341e6b4a9882)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
<?xml version="1.0" encoding="UTF-8"?>

<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" accelerated="11">
<head>
  <link href="chrome://communicator/skin/fullscreen-video.css"
        rel="stylesheet" type="text/css"/>
  <script type="application/javascript"><![CDATA[

var contentVideo = window.arguments[0];
var isPaused = window.arguments[1];
var video;
var closeIcon;

var title = (contentVideo.currentSrc || contentVideo.src).replace(/^.*\//, "");
try {
  title = decodeURI(title);
} catch (e) {}
document.title = title;

window.addEventListener("focus", onFocus, false);
window.addEventListener("unload", onUnload, false);
window.addEventListener("keypress", onKeyPress, false);

function onFocus() {
  window.removeEventListener("focus", onFocus, false);

  window.fullScreen = true;

  window.addEventListener("deactivate", autoClose, false);

  video = document.querySelector("video");
  closeIcon = document.querySelector("div");

  video.addEventListener("loadeddata", onLoadedData, false);

  // Automatically close this window when the playback ended, unless the user
  // interacted with it.
  video.addEventListener("ended", autoClose, false);
  window.addEventListener("click", cancelAutoClose, false);
  window.addEventListener("keypress", cancelAutoClose, false);

  video.addEventListener("playing", hideUI, false);
  video.addEventListener("seeked", hideUI, false);
  video.addEventListener("seeking", showUI, false);
  video.addEventListener("pause", showUI, false);
  video.addEventListener("ended", showUI, false);

  window.addEventListener("mousemove", onMouseMove, false);

  video.src = contentVideo.currentSrc || contentVideo.src;
}

function onLoadedData() {
  video.removeEventListener("loadeddata", onLoadedData, false);
  video.volume = contentVideo.volume;
  video.muted = contentVideo.muted;
  video.poster = contentVideo.poster;

  if (contentVideo.currentTime && !contentVideo.ended) {
    video.addEventListener("seeked", playbackStarts, false);

    video.currentTime = contentVideo.currentTime;
  } else {
    playbackStarts();
  }

  video.controls = true;

  if (!isPaused)
    video.play();
}

function onMouseMove() {
  showUI();
  resetIdleTimer();
}

function onUnload() {
  if (video.currentSrc) {
    contentVideo.currentTime = video.currentTime;
    contentVideo.volume = video.volume;
    contentVideo.muted = video.muted;
    if (!video.paused && !video.ended) {
      video.pause();
      contentVideo.play();
    }
  }
}

function onKeyPress(event) {
  if (event.keyCode == event.DOM_VK_ESCAPE) {
    window.close();
    return;
  }

  resetIdleTimer();

  if (!video.controls &&
      String.fromCharCode(event.charCode) == " ")
    video.pause();
}

function playbackStarts() {
  video.removeEventListener("seeked", playbackStarts, false);

  // Loading the data from the content video may take a second or two. We hide
  // the video during that period.
  document.body.style.visibility = "visible";
  video.focus();
}

function autoClose() {
  window.close();
}

function cancelAutoClose() {
  video.removeEventListener("ended", autoClose, false);
  window.removeEventListener("click", cancelAutoClose, false);
  window.removeEventListener("keypress", cancelAutoClose, false);
}

var idleTimer = 0;
function resetIdleTimer() {
  clearTimeout(idleTimer);
  idleTimer = setTimeout(hideUI, 2000);
}

function showUI() {
  if (!video.controls) {
    window.setCursor("auto");
    closeIcon.style.visibility = "visible";
    video.controls = true;
  }
}

function hideUI() {
  if (!video.paused && !video.ended && !video.seeking && !video.error) {
    window.setCursor("none");
    closeIcon.style.visibility = "hidden";
    video.controls = false;
  }
}

  ]]></script>
</head>
<body>
  <div onclick="window.close();"/>
  <video/>
</body>
</html>