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
<!DOCTYPE html>
<html>
<head>
<title>Matt's video player</title>
<script>
  function playAndPause()
   {
     var v = document.getElementById("vid");
     var pause = document.getElementById("pauseButton");
     var play = document.getElementById("playButton");

     if (v.paused)
     {
        pause.style.display="inline";
        play.style.display="none";
        v.play();
     } else {
        play.style.display="inline";
        pause.style.display="none";
        v.pause();
     }

   }



</script>
</head>
<body>

 <video id="vid" src="octopus.ogv"
              width="360" height="240"></video>

 <p><button id="playButton" >Play</button>
  <button id="pauseButton" style="display:none">Pause</button>
<p>
<script>
var pause = document.getElementById("pauseButton");
var play = document.getElementById("playButton");
pause.addEventListener("click",playAndPause,true);
play.addEventListener("click",playAndPause,true);

</script>
</body>
</html>