-
Notifications
You must be signed in to change notification settings - Fork 0
/
minimal.html
60 lines (48 loc) · 1.37 KB
/
minimal.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
60
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<title>Minimal Ogv.js example</title>
<script src="lib/ogv.js?version=1.7.0-20200619235241-9f71bb8"></script>
</head>
<body>
<div id="videoarea"></div>
<select onchange="switchmedia(this)">
<option value="media/llama-drama-av1.webm">Llama drama (AV1, Opus; 180p)</option>
<option value="media/curiosity.ogv">Curiosity's Seven Minutes of Terror (Vorbis, Theora; 160p)</option>
<option value="media/ehren-paper_lights-96.opus">Ehren - Paper Lights (Opus)</option>
<option value="media/pixel_aspect_ratio.ogg">Theora Test suite pixel_aspect_ratio.ogg</option>
</select>
<div>
<button onclick="play(sampleFile);">Play</button><button onclick="pause();">Pause/Unpause</button>
</div>
<script language="JavaScript">
var player = null;
var paused = false;
var sampleFile = 'media/llama-drama-av1.webm';
player = new OGVPlayer();
document.getElementById("videoarea").appendChild(player);
function play(src) {
//player = new OgvSwfPlayer();
//player = document.createElement('video');
player.src = src;
player.play();
}
function pause() {
if(player) {
if(!paused) {
player.pause();
paused = true;
} else {
player.play();
paused = false;
}
}
}
function switchmedia(src) {
sampleFile = src.value;
play(sampleFile);
}
</script>
</body></html>