From 6f7b34f644c5c30bf26bd63235a532482d5c35be Mon Sep 17 00:00:00 2001 From: calzoneman Date: Mon, 3 Aug 2015 19:02:56 -0700 Subject: [PATCH] Minor fixes to source quality sorting --- player/videojs.coffee | 4 ++-- www/js/player.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/player/videojs.coffee b/player/videojs.coffee index b58b510f..c62445c5 100644 --- a/player/videojs.coffee +++ b/player/videojs.coffee @@ -7,9 +7,9 @@ sortSources = (sources) -> pref = String(USEROPTS.default_quality) idx = qualities.indexOf(pref) if idx < 0 - pref = '480' + idx = 2 - qualityOrder = qualities.slice(idx).concat(qualities.slice(0, idx)) + qualityOrder = qualities.slice(idx).concat(qualities.slice(0, idx).reverse()) sourceOrder = [] flvOrder = [] for quality in qualityOrder diff --git a/www/js/player.js b/www/js/player.js index 95688d78..2ce598eb 100644 --- a/www/js/player.js +++ b/www/js/player.js @@ -454,9 +454,9 @@ pref = String(USEROPTS.default_quality); idx = qualities.indexOf(pref); if (idx < 0) { - pref = '480'; + idx = 2; } - qualityOrder = qualities.slice(idx).concat(qualities.slice(0, idx)); + qualityOrder = qualities.slice(idx).concat(qualities.slice(0, idx).reverse()); sourceOrder = []; flvOrder = []; for (j = 0, len = qualityOrder.length; j < len; j++) {