Add Justin.tv support

This commit is contained in:
calzoneman 2013-05-17 14:39:58 -04:00
parent 79ec535358
commit 66fbbb77ce
7 changed files with 51 additions and 2 deletions

View file

@ -500,6 +500,8 @@ function parseVideoURL(url){
}
else if(url.indexOf("twitch.tv") != -1)
return [parseTwitch(url), "tw"];
else if(url.indexOf("justin.tv") != -1)
return [parseJustinTV(url), "jt"];
else if(url.indexOf("livestream.com") != -1)
return [parseLivestream(url), "li"];
else if(url.indexOf("ustream.tv") != -1)
@ -544,6 +546,14 @@ function parseTwitch(url) {
return null;
}
function parseJustinTV(url) {
var m = url.match(/justin\.tv\/([a-zA-Z0-9]+)/);
if(m) {
return m[1];
}
return null;
}
function parseLivestream(url) {
var m = url.match(/livestream\.com\/([a-zA-Z0-9]+)/);
if(m) {

View file

@ -28,6 +28,9 @@ var Media = function(data) {
case "tw":
this.initTwitch();
break;
case "jt":
this.initJustinTV();
break;
case "rt":
this.initRTMP();
break;
@ -322,6 +325,33 @@ Media.prototype.initTwitch = function() {
this.seek = function() { }
}
Media.prototype.initJustinTV = function() {
this.removeOld();
var url = "http://www.justin.tv/widgets/live_embed_player.swf?channel="+this.id;
var params = {
allowFullScreen:"true",
allowScriptAccess:"always",
allowNetworking:"all",
movie:"http://www.justin.tv/widgets/live_embed_player.swf",
id: "live_embed_player_flash",
flashvars:"hostname=www.justin.tv&channel="+this.id+"&auto_play=true&start_volume=100"
};
swfobject.embedSWF( url, "ytapiplayer", VWIDTH, VHEIGHT, "8", null, null, params, {} );
this.load = function(data) {
this.id = data.id;
this.initTwitch();
}
this.pause = function() { }
this.play = function() { }
this.getTime = function() { }
this.seek = function() { }
}
Media.prototype.initRTMP = function() {
this.removeOld();
var url = "http://fpdownload.adobe.com/strobe/FlashMediaPlayback_101.swf";

View file

@ -140,6 +140,7 @@
<li>http://www.soundcloud.com/(songid)</li>
<li>http://www.dailymotion.com/video/(videoid)</li>
<li>http://www.twitch.tv/(channel)</li>
<li>http://www.justin.tv/(channel)</li>
<li>http://www.livestream.com/(channel)</li>
<li>http://www.ustream.tv/(channel)</li>
<li>rtmp://(stream url)</li>