IT'S THE FINAL COUNTDOWN

This commit is contained in:
calzoneman 2013-06-23 14:21:21 -04:00
parent 1a3d92c903
commit 67dee59c3f
4 changed files with 42 additions and 4 deletions

View file

@ -33,6 +33,7 @@ var CHANNEL = {
};
var PLAYER = false;
var VIDEOQUALITY = false;
var FLUIDLAYOUT = false;
if($("#ytapiplayer").length > 0) {
var VWIDTH = $("#ytapiplayer").parent().css("width").replace("px", "");

View file

@ -76,8 +76,12 @@ Player.prototype.initYouTube = function() {
width: VWIDTH,
videoId: this.id,
playerVars: {
"autoplay": 1,
"controls": 1,
autohide: 1, // Autohide controls
autoplay: 1, // Autoplay video
controls: 1, // Show controls
iv_load_policy: 3, // No annotations
modestbranding: 1, // No logo
rel: 0 // No related videos
},
events: {
onReady: function() {
@ -103,6 +107,8 @@ Player.prototype.initYouTube = function() {
this.load = function(data) {
if(this.player.loadVideoById) {
this.player.loadVideoById(data.id, data.currentTime);
if(VIDEOQUALITY)
this.player.setPlaybackQuality(VIDEOQUALITY);
this.id = data.id;
}
}

View file

@ -181,6 +181,24 @@ $("#userpl_save").click(function() {
});
});
/* video controls */
(function() {
function qualHandler(select, preset) {
$(select).click(function() {
VIDEOQUALITY = preset;
var btn = $("#qualitywrap .btn.dropdown-toggle");
var caret = btn.find(".caret").detach();
btn.text($(select).text());
caret.appendTo(btn);
});
}
qualHandler("#quality_240p", "small");
qualHandler("#quality_360p", "medium");
qualHandler("#quality_480p", "large");
qualHandler("#quality_720p", "hd720");
qualHandler("#quality_1080p", "hd1080");
})();
/* playlist controls */
$("#queue").sortable({