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({

View File

@ -97,7 +97,7 @@
<div class="row-fluid" id="leftpane-inner">
<!-- new poll controls -->
<div class="span12" id="pollbtnwrap">
<button class="btn btn-primary btn-small" id="newpollbtn">New Poll</button>
<button class="btn btn-small" id="newpollbtn">New Poll</button>
</div>
<!-- poll container -->
<div class="span12" id="pollwrap">
@ -143,7 +143,20 @@
<div class="span7" id="rightpane-outer">
<div class="row-fluid" id="rightpane-inner">
<!-- account for left pane having the poll buffer -->
<div class="span12" id="queue_align"></div>
<div class="span12" id="qualitywrap">
<div class="btn-group">
<a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="javascript:void(0)">
Quality <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a id="quality_240p" href="javascript:void(0)">240p</a></li>
<li><a id="quality_360p" href="javascript:void(0)">360p</a></li>
<li><a id="quality_480p" href="javascript:void(0)">480p</a></li>
<li><a id="quality_720p" href="javascript:void(0)">720p</a></li>
<li><a id="quality_1080p" href="javascript:void(0)">1080p</a></li>
</ul>
</div>
</div>
<!-- electric boogaloo -->
<div class="span12" id="queue_align2"></div>
<!-- playlist controls -->