-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvlc.html
122 lines (116 loc) · 4.87 KB
/
vlc.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="">
<meta name="created" content="2012-07-05">
<title> Prototype</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/3.4.1/build/cssreset/reset-min.css">
<link rel="stylesheet" href="http://yui.yahooapis.com/3.4.1/build/cssfonts/fonts-min.css">
<style type="text/css">
</style>
</head>
<body>
<div id="vlc" >
</div>
<div id="controls">
<input type="button" value="pause" id="togglePause" />
<input type="button" value="resume" />
<input type="button" value="stop" id="stop" />
<input type="button" value="volume up" id="vup" />
<input type="button" value="volume down" id="vdown" />
<input type="button" value="mute" />
<input type="button" value="unmute" />
<input type="button" value="fullscreen" id="toggleFullscreen"/>
<input type="button" value="get size" id="size"/>
<input type="button" value="get time" id="time"/>
<input type="button" value="set time" id="time"/>
<input type="button" value="get state" id="state"/>
<input type="button" value="play" id="play"/>
<input type="button" value="next" id="play"/>
<input type="button" value="destroy" id="destroy"/>
</div>
<script type="text/javascript" src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script>
<script type="text/javascript" src="vlc.js"></script>
<script>
YUI().use("vlc","node-event-delegate", function (Y) {
var eventHandler,
vlc,
config,
stateCheck;
config = {
"container": "#vlc",
"url": "http://dl.dropbox.com/u/10258402/GokKUqLcvD8.mp4"
};
vlc = new Y.VLC(config);
eventHandler = function (event) {
var action = event.currentTarget.get("value");
switch (action) {
case 'pause' :
vlc.pause();
break
case 'stop' :
vlc.stop();
break
case 'volume up' :
vlc.set("volume",vlc.get("volume")+1);
break
case 'volume down' :
vlc.set("volume",vlc.get("volume")-1);
break
case 'mute' :
vlc.mute();
break;
case 'unmute' :
vlc.unmute();
break;
case 'fullscreen' :
vlc.set("fullscreen", true);
Y.log("is fullscreen "+vlc.get("fullscreen") );
break
case 'get size' :
alert("width:"+vlc.get("size")[0]+" height:"+vlc.get("size")[1]);
break
case 'get time' :
alert("get time: "+vlc.get("position")+" total: "+vlc.get("duration"));
break
case 'get state' :
alert(vlc.get("state"));
break
case 'play' :
vlc.play();
break
case 'resume' :
vlc.resume();
break
case 'destroy' :
vlc.destroy();
break
case 'next' :
vlc.stop();
vlc.play("http://o-o---preferred---fareastone-khh1---v9---lscache4.c.youtube.com/videoplayback?upn=4jeVf8ZgtBg&sparams=cp%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&fexp=920912%2C911628%2C915507%2C907217%2C922401%2C919804%2C920704%2C912806%2C906055%2C924500%2C924700%2C913547%2C904721%2C920706%2C907344%2C912706%2C900816%2C902518%2C909414&ms=au&itag=43&ipbits=8&signature=0DC4994A27CAF90754438F0B15B8D0B5DDEDA7E1.9285558C04A20508A77CDAFC385736EED32435FD&mv=m&sver=3&mt=1343980578&ratebypass=yes&source=youtube&expire=1344002080&key=yt1&ip=218.211.33.134&cp=U0hTSVBLUF9NSkNOM19IRVRBOmpscmZ4WnNleXpR&id=ae86fe0d2fa34be6");
break
}
};
if (vlc.get("installed")) {
//vlc.play("http://www.revolunet.com/static/download/labo/VLCcontrols/bunny.mp4");
// vlc.play("http://people.videolan.org/~dionoea/vlc-plugin-demo/streams/sw_h264.asf");
// vlc.play();
Y.one("#controls").delegate('click', eventHandler, 'input');
}
vlc.on("buffering", function(e){
Y.log("VLC buffering");
});
vlc.on("ready", function(e){
Y.log("VLC ready");
});
vlc.on("playing", function(e){
Y.log("playing - duration = " + e.duration + "/ position = " + e.position);
});
vlc.after("stateChange", function(e){
Y.log("State change from "+e.prevVal +" to "+e.newVal );
});
});
</script>
</body>
</html>