-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideo_dom.html
59 lines (47 loc) · 1.28 KB
/
video_dom.html
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
<!DOCTYPE html>
<html>
<header>
<title>HTML5 Video+DOM</title>
</header>
<body>
<h1>HTML5 Video+DOM</h1>
<h4>DOM is a way for page events to activate javascript code</h4>
<div style="text-align:center">
<button onclick="playPause()">Play/Pause</button>
<button onclick="makeBig()">Big</button>
<button onclick="makeSmall()">Small</button>
<button onclick="makeNormal()">Normal</button>
<br />
<video id="video1" width="420">
<source src="http://www.w3schools.com/html5/mov_bbb.mp4" type="video/mp4" />
<source src="http://www.w3schools.com/html5/mov_bbb.ogg" type="video/ogg" />
Your browser does not support HTML5 video.
</video>
</div>
<script type="text.javascript">
var my Video=document.getElementById("video1");
function playPause()
{
if (myVideo.paused)
myVideo.play();
else
myVideo.pause();
}
function makeBig()
{
myVideo.width=560;
}
function makeSmall()
{
myVideo.width=320;
}
function makeNormal()
{
myVideo.width=420;
}
</script>
<p>
Video courtesy of <a href="http://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.
</p>
</body>
</html>