forked from mounirlamouri/sandbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
media-focus.html
53 lines (51 loc) · 1.6 KB
/
media-focus.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
<!DOCTYPE html>
<html>
<head>
<title>Media Focus Test Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<section>
<h2>HTML5 Audio</h2>
<h3>Tetris<h3>
<audio id=tetris controls>
<source src="media/tetris.mp3" type='audio/mp3'>
<source src="media/tetris.ogg" type='audio/ogg; codecs=vorbis'>
</audio>
<button onclick="delayedPlayback();">delayed playback</button>
<h3>Pacmac</h3>
<audio id=pacman controls>
<source src="media/pacman_beginning.mp3" type='audio/mp3'>
<source src="media/pacman_beginning.ogg" type='audio/ogg; codecs=vorbis'>
</audio>
<h3>Mario Coin</h3>
<audio id=coin controls>
<source src="media/smw_coin.mp3" type='audio/mp3'>
</audio>
</section>
<section>
<h2>HTML5 Video</h2> <small>webkit-playsinline</small>
<video id="html5-video" controls autobuffer width='300' height='200'
poster="media/BigBuck_360x240.jpg" webkit-playsinline>
<source src="media/BigBuck.m4v">
<source src="media/BigBuck.webm" type="video/webm">
<source src="media/BigBuck.theora.ogv" type="video/ogg">
</video>
</section>
<section>
<h2>Youtube (iframes)</h2>
<iframe id="ytplayer" type="text/html" width='300' height='200'
src="https://www.youtube.com/embed/h8CEU0iPmqM" frameborder="0">
</iframe>
</section>
</body>
<script>
function delayedPlayback() {
var audio = document.querySelector('audio');
audio.play(); audio.pause();
setTimeout(function() {
document.querySelector('audio').play();
}, 2000);
}
</script>
</html>