Support custom embeds (no UI for it yet)
This commit is contained in:
parent
1aeec527f6
commit
fe2ec2c8d2
4 changed files with 47 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue