-
Notifications
You must be signed in to change notification settings - Fork 0
/
tinyplayer.html
66 lines (43 loc) · 1.25 KB
/
tinyplayer.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
<html>
<head>
<title>UC Player</title>
<script type="text/javascript" src="lib/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="lib/strophe.js"></script>
<script type="text/javascript" src="lib/buttons.js"></script><!-- depends on jquery -->
<link type="text/css" rel="stylesheet" href="css/player.css" />
<script type="text/javascript">
var buttons = null;
var emp = null;
var me = null;
var lastmsg;
var playvideo = false;
function show_message(msg){
if(msg!=lastmsg){
$("#overlay").html(msg);
$("#overlay").fadeIn().delay(5000).fadeOut('slow');
lastmsg = msg;
}
}
function init(){
show_message("Welcome to Simple TV");
var pr = tmp_name();
buttons = new ButtonsLink({"server":"jabber.example.com"});
me = new TV(pr,pr);
buttons.connect(me,"default_muc",function(){});//might want to change the room
}
function tmp_name(){
var rand = Math.floor(Math.random()*9999)
return "telly_"+String(rand);
}
$(document).bind('tv_changed', function (e,item) {
var programme = item.nowp;
me.nowp = item.nowp;
show_message("Playing "+programme["title"]);
});
</script>
</head>
<body onload="javascript:init()">
<div id="overlay" style="display:none;" class="overlay">
</div>
</body>
</html>