This commit is contained in:
calzoneman 2013-06-30 15:56:41 -04:00
parent e030a2bfa6
commit 543ec91e9b
3 changed files with 18 additions and 4 deletions

View file

@ -58,6 +58,7 @@ var Player = function(data) {
this.nullPlayer();
break;
}
this.load(data);
}
Player.prototype.nullPlayer = function() {
@ -114,19 +115,23 @@ Player.prototype.initYouTube = function() {
}
this.pause = function() {
this.player.pauseVideo();
if(this.player.pauseVideo)
this.player.pauseVideo();
}
this.play = function() {
this.player.playVideo();
if(this.player.playVideo)
this.player.playVideo();
}
this.getTime = function(callback) {
callback(this.player.getCurrentTime());
if(this.player.getCurrentTime)
callback(this.player.getCurrentTime());
}
this.seek = function(time) {
this.player.seekTo(time, true);
if(this.player.seekTo)
this.player.seekTo(time, true);
}
}

View file

@ -190,6 +190,8 @@ $("#userpl_save").click(function() {
var caret = btn.find(".caret").detach();
btn.text($(select).text());
caret.appendTo(btn);
if(PLAYER.type == "yt" && PLAYER.player.setPlaybackQuality)
PLAYER.player.setPlaybackQuality(VIDEOQUALITY);
});
}
qualHandler("#quality_240p", "small");
@ -199,6 +201,12 @@ $("#userpl_save").click(function() {
qualHandler("#quality_1080p", "hd1080");
})();
$("#mediarefresh").click(function() {
PLAYER.type = "";
PLAYER.id = "";
socket.emit("playerReady");
});
/* playlist controls */
$("#queue").sortable({

View file

@ -156,6 +156,7 @@
<li><a id="quality_1080p" href="javascript:void(0)">1080p</a></li>
</ul>
</div>
<button class="btn btn-small" id="mediarefresh">Refresh Media</button>
</div>
<!-- electric boogaloo -->
<div class="span12" id="queue_align2"></div>