Support custom embeds (no UI for it yet)

This commit is contained in:
calzoneman 2013-08-03 11:12:53 -04:00
parent 1aeec527f6
commit fe2ec2c8d2
4 changed files with 47 additions and 2 deletions

View file

@ -66,6 +66,9 @@ var Player = function(data) {
case "im":
this.initImgur();
break;
case "cu":
this.initCustom();
break;
default:
this.nullPlayer();
break;
@ -627,6 +630,33 @@ Player.prototype.initImgur = function() {
this.seek = function() { }
}
Player.prototype.initCustom = function() {
var div = $("<div/>").insertBefore($("#ytapiplayer"));
$("#ytapiplayer").remove();
div.append(this.id);
this.player = div.find("iframe") || div.find("object")
|| div.find("embed") || div;
this.player.attr("id", "ytapiplayer");
this.player.attr("width", VWIDTH);
this.player.attr("height", VHEIGHT);
this.load = function(data) {
this.id = data.id;
this.initCustom()
}
this.pause = function() { }
this.play = function() { }
this.isPaused = function() { }
this.getTime = function() { }
this.seek = function() { }
}
Player.prototype.update = function(data) {
this.currentTime = data.currentTime;
if(data.id && data.id != this.id) {