This repository has been archived by the owner on May 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
/
stream.html
64 lines (52 loc) · 1.43 KB
/
stream.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
61
62
63
64
<!DOCTYPE html>
<html>
<head>
<link href="content/style.css" media="screen" rel="stylesheet" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="webOSjs-0.1.0/webOS.js" charset="utf-8"></script>
<script src="bundle.js" charset="utf-8"></script>
<script>
// Format code from http://stackoverflow.com/questions/610406/javascript-equivalent-to-printf-string-format
if (!String.prototype.format) {
String.prototype.format = function() {
var args = arguments;
return this.replace(/{(\d+)}/g, function(match, number) {
return typeof args[number] != 'undefined'
? args[number]
: match
;
});
};
}
(function ($) {
$(document).ready( function ()
{
var channel = location.hash;
channel = channel.replace(/\#/g,"");
getStreamFromChannel(channel).done(function(streams) {
var video = document.getElementById('video');
var source = document.createElement('source');
source.setAttribute('src', streams[0].url);
video.appendChild(source);
video.play();
}, function(e){
console.log("error", e);
});
});
})(jQuery);
</script>
</head>
<body>
<div class="left_panel_stream">
<div class="back">
<a href="index.html">
<img src="content/back.png"/>
</a>
</div>
<video id="video" width="100%" height="100%" controls>
</video>
</div>
<div class="left_panel_chat">
</div>
</body>
</html>