summaryrefslogtreecommitdiffstats
path: root/browser/components/touchbar/tests/browser/video_test.html
blob: 173de35f0e169a5ce121b254eda3f7fd4187b20d (plain)
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
<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>Touch Bar Fullscreen Video Test</title>
</head>
<style>
  video {
    display: block;
    border: 1px solid black;
  }
</style>
<body>
  <video id="test-video" src="test-video.mp4" controls loop="true"></video>
</body>
<script>
  let video = document.getElementById("test-video");

  function toggleFullScreen() {
    if (!document.fullscreenElement) {
        document.documentElement.requestFullscreen();
    } else if (document.exitFullscreen) {
      document.exitFullscreen();
    }
  }
  document.addEventListener("keydown", function(e) {
    if (e.keyCode == 13) {
      toggleFullScreen();
    }
  });
</script>
</html>