summaryrefslogtreecommitdiffstats
path: root/mobile/android/focus-android/app/src/androidTest/assets/audioPage.html
blob: 887602dfed1e1c3e3d3a862607d0c41678a3f105 (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
<html>
  <head>
    <title>Audio_Test_Page</title>
  </head>
  <body>
    <p id="testContent">Page content: audio player</p>

    <div class="audioPlayer">
      <audio id="audioSample" controls loop>
        <source src="resources/audioSample.mp3" />
      </audio>
    </div>

    <div class="playbackState"></div>

    <script>
      const audio = document.querySelector("audio");
      var showPlayingAlert = true;

      audio.addEventListener("playing", event => {
        <!--document.querySelector('.playbackState').innerText="Media file is playing"-->
        <!--Need this hack to verify that the video is playing,-->
        <!--the test cannot currently verify the text displayed on the page-->
        if (showPlayingAlert === true) {
          showPlayingAlert = false;
          alert("Media file is playing");
        }
      });

      audio.addEventListener("pause", event => {
        <!--document.querySelector('.playbackState').innerText="Media file is paused"-->
        alert("Media file is paused");
      });
    </script>
  </body>
</html>