summaryrefslogtreecommitdiffstats
path: root/mobile/android/fenix/app/src/androidTest/assets/pages/videoMediaPage.html
blob: 3245cb5fa2d0ce12f702e0895a09a91ed7b4c66e (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<!-- 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/. -->
<html>
  <head>
    <title>Video_Test_Page</title>
  </head>
  <body>
    <p id="testContent">Page content: video player</p>
    <div class="playbackState">
      <p>Media file not playing</p>
    </div>
    <div id="video-container" style="text-align: center">
      <button onclick="play()">Play</button>
      <button onclick="pause()">Pause</button>
      <button onclick="fullscreen()">Full Screen</button>
      <br /><br />
      <video id="video" width="420" autoplay controls loop>
        <source src="../resources/clip.mp4" type="video/mp4" />
        Your browser does not support HTML video.
      </video>
    </div>

    <script>
      const video = document.getElementById("video");

      function play() {
        video.play();
      }

      function pause() {
        video.pause();
      }

      function fullscreen() {
        video.requestFullscreen();
      }

      video.addEventListener("playing", event => {
        document.querySelector(".playbackState").innerHTML =
          "Media file is playing";
      });

      video.addEventListener("pause", event => {
        document.querySelector(".playbackState").innerHTML =
          "Media file is paused";
      });
    </script>
  </body>
</html>