Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

123 lines (116 sloc) 4.99 kb
<!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>
Jump to Line
Something went wrong with that request. Please try again.