forked from Orange-OpenSource/hasplayer.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
baseline.html
50 lines (42 loc) · 1.31 KB
/
baseline.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Baseline hasplayer.js Player</title>
<meta name="description" content="" />
<!-- Minified hasplayer.js -->
<script src="dist/hasplayer.min.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://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest",
video,
mediaPlayer;
if (vars && vars.hasOwnProperty("url")) {
url = vars.url;
}
video = document.querySelector(".hasplayer-video-player video");
mediaPlayer = new MediaPlayer();
mediaPlayer.init(video);
mediaPlayer.load({url: url});
}
</script>
<style>
video {
width: 640px;
height: 480px;
}
</style>
<body onload="startVideo()">
<div class="hasplayer-video-player">
<video controls="true"></video>
</div>
</body>
</html>