From 9c7e93ecf8768f9c6b310f89a5e8bc69aba555e3 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Mon, 6 Sep 2021 12:58:27 -0700 Subject: Redo av codec settings & selections to accomodate webm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows for ranked preferences for h264, av1, and vp9 codecs in settings, along with equal preferences which are tiebroken using smaller file size. For each quality, gives av-merge a list of video sources and audio sources sorted based on preference & file size. It will pick the first one that the browser supports. Closes #84 Signed-off-by: Jesús --- youtube/static/js/plyr-start.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'youtube/static/js/plyr-start.js') diff --git a/youtube/static/js/plyr-start.js b/youtube/static/js/plyr-start.js index a72ab9c..82b32d6 100644 --- a/youtube/static/js/plyr-start.js +++ b/youtube/static/js/plyr-start.js @@ -20,10 +20,10 @@ qualityOptions.push(src.quality_string) } for (var src of data['pair_sources']) { - qualityOptions.push(src[0].quality_string) + qualityOptions.push(src.quality_string) } if (data['using_pair_sources']) - qualityDefault = data['pair_sources'][data['pair_idx']][0].quality_string; + qualityDefault = data['pair_sources'][data['pair_idx']].quality_string; else if (data['uni_sources'].length != 0) qualityDefault = data['uni_sources'][data['uni_idx']].quality_string; else @@ -108,7 +108,7 @@ } } else { for (var i=0; i < data['pair_sources'].length; i++) { - if (data['pair_sources'][i][0].quality_string == quality) { + if (data['pair_sources'][i].quality_string == quality) { changeQuality({'type': 'pair', 'index': i}); return; } -- cgit v1.2.3