Add no_h264 option

This commit is contained in:
calzoneman 2014-02-28 09:43:48 -06:00
parent b6a1e05cd0
commit 8c32ce4020
3 changed files with 21 additions and 1 deletions

View File

@ -59,6 +59,10 @@ mixin us-playback
.col-sm-4
.col-sm-8
p.text-info Setting <code>wmode=transparent</code> allows objects to be displayed above the video player, but may cause performance issues on some systems.
mixin rcheckbox("us-no-h264", "Use JWPlayer for h.264 playback")
.col-sm-4
.col-sm-8
p.text-info Some browsers (e.g. Firefox &lt;=28) do not support native h.264 video playback. This option allows such content to be played using JWPlayer's flash player.
mixin rcheckbox("us-hidevideo", "Remove the video player")
mixin rcheckbox("us-playlistbuttons", "Hide playlist buttons by default")
mixin rcheckbox("us-oldbtns", "Old style playlist buttons")

View File

@ -98,6 +98,19 @@ function getOrDefault(k, def) {
return v;
}
function default_noh264() {
var ua = navigator.userAgent + "";
if (ua.match(/Chrome|Chromium/)) {
return false;
} else if (ua.match(/Firefox/)) {
var version = ua.match(/Firefox\/(\d+)/)[1];
version = parseInt(version);
return version >= 29;
} else {
return true;
}
}
var USEROPTS = {
theme : getOrDefault("theme", "/css/themes/slate.css"),
layout : getOrDefault("layout", "fluid"),
@ -120,7 +133,8 @@ var USEROPTS = {
sort_afk : getOrDefault("sort_afk", false),
default_quality : getOrDefault("default_quality", ""),
boop : getOrDefault("boop", false),
secure_connection : getOrDefault("secure_connection", false)
secure_connection : getOrDefault("secure_connection", false),
no_h264 : getOrDefault("no_h264", default_noh264())
};
var VOLUME = parseFloat(getOrDefault("volume", 1));

View File

@ -601,6 +601,7 @@ function showUserOptions() {
$("#us-synch").prop("checked", USEROPTS.synch);
$("#us-synch-accuracy").val(USEROPTS.synch_accuracy);
$("#us-wmode-transparent").prop("checked", USEROPTS.wmode_transparent);
$("#us-no-h264").prop("checked", USEROPTS.no_h264);
$("#us-hidevideo").prop("checked", USEROPTS.hidevid);
$("#us-playlistbuttons").prop("checked", USEROPTS.qbtn_hide);
$("#us-oldbtns").prop("checked", USEROPTS.qbtn_idontlikechange);
@ -631,6 +632,7 @@ function saveUserOptions() {
USEROPTS.synch = $("#us-synch").prop("checked");
USEROPTS.synch_accuracy = parseFloat($("#us-synch-accuracy").val()) || 2;
USEROPTS.wmode_transparent = $("#us-wmode-transparent").prop("checked");
USEROPTS.no_h264 = $("#us-no-h264").prop("checked");
USEROPTS.hidevid = $("#us-hidevideo").prop("checked");
USEROPTS.qbtn_hide = $("#us-playlistbuttons").prop("checked");
USEROPTS.qbtn_idontlikechange = $("#us-oldbtns").prop("checked");