Add JWPlayer support

This commit is contained in:
calzoneman 2013-04-28 17:06:58 -05:00
parent 4bdbac3dbd
commit 7f7ae16138
7 changed files with 61 additions and 17 deletions

View file

@ -427,6 +427,10 @@ function parseVideoURL(url){
url = url.trim()
if(typeof(url) != "string")
return null;
if(url.indexOf("jw:") == 0) {
url = url.substring(3);
return [url, "jw"];
}
if(url.indexOf("rtmp://") == 0) {
return [url, "rt"];
}

View file

@ -25,6 +25,9 @@ var Media = function(data) {
case "rt":
this.initRTMP();
break;
case "jw":
this.initJWPlayer();
break;
default:
break;
}
@ -278,6 +281,31 @@ Media.prototype.initRTMP = function() {
this.seek = function() { }
}
Media.prototype.initJWPlayer = function() {
this.removeOld();
jwplayer("ytapiplayer").setup({
file: this.id,
width: VWIDTH,
height: VHEIGHT,
autostart: true
});
setTimeout(function() {$("#ytapiplayer_logo").remove();}, 1000);
this.load = function(data) {
this.id = data.id;
this.initJWPlayer();
}
this.pause = function() { }
this.play = function() { }
this.getTime = function() { }
this.seek = function() { }
}
Media.prototype.update = function(data) {
if(data.id != this.id) {
if(data.currentTime < 0) {