forked from Hyddan/dash.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug.html
51 lines (47 loc) · 1.47 KB
/
debug.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Baseline Dash JavaScript Player</title>
<meta name="description" content="" />
<link rel="icon" type="image/png" href="http://dashpg.com/w/2012/09/dashif.ico" />
<!-- Concatenated Dash & Libraries -->
<script src="dash.debug.js"></script>
<script>
function getUrlVars() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
vars[key] = value;
});
return vars;
}
function startVideo() {
var vars = getUrlVars(),
url = "http://localhost/Playground/Dash/Manifest.mpd",
video,
context,
player;
if (vars && vars.hasOwnProperty("url")) {
url = vars.url;
}
video = document.querySelector(".dash-video-player video");
context = new Dash.di.DashContext();
player = new MediaPlayer(context);
player.startup();
player.attachView(video);
player.setAutoPlay(false);
player.attachSource(url);
}
</script>
<style>
video {
width: 640px;
height: 480px;
}
</style>
<body onload="startVideo()">
<div class="dash-video-player">
<video controls="true"></video>
</div>
</body>
</html>