aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/static/js/watch.dash.js
diff options
context:
space:
mode:
authorAstounds <kirito@disroot.org>2026-05-03 12:32:55 -0500
committerAstounds <kirito@disroot.org>2026-05-03 12:32:55 -0500
commit8d66143c90c4b86e8ec8dfed67753bef2abf2114 (patch)
treef7d73591c228cf52c7a4abd15c855d7d06e80ff8 /youtube/static/js/watch.dash.js
parent50ad959a8051fec95f26b573f9fe067bdf3fdf6a (diff)
downloadyt-local-8d66143c90c4b86e8ec8dfed67753bef2abf2114.tar.lz
yt-local-8d66143c90c4b86e8ec8dfed67753bef2abf2114.tar.xz
yt-local-8d66143c90c4b86e8ec8dfed67753bef2abf2114.zip
fix: update innertube clients and fix HLS/DASH quality switching
- Update innertube client versions to match yt-dlp (android 21.02.35, ios 21.02.3, web 2.20260114.08.00, android_vr 1.65.10) - Remove obsolete clients (android-test-suite, ios_vr) - Replace tv_embedded with TVHTML5_SIMPLY (cn 75) - Add new clients: web_embedded, mweb, tv - Fix HLS freeze on quality switch: use nextLevel instead of currentLevel, handle bufferStalledError, stream proxy segments instead of buffering in memory - Populate DASH quality selector with actual sources (no Auto) - Render quality-select empty in template, let JS populate per mode
Diffstat (limited to 'youtube/static/js/watch.dash.js')
-rw-r--r--youtube/static/js/watch.dash.js27
1 files changed, 26 insertions, 1 deletions
diff --git a/youtube/static/js/watch.dash.js b/youtube/static/js/watch.dash.js
index cb02421..5bbc7a2 100644
--- a/youtube/static/js/watch.dash.js
+++ b/youtube/static/js/watch.dash.js
@@ -31,9 +31,34 @@ if (data.using_pair_sources) {
avMerge = new AVMerge(video, srcPair, 0);
}
-// Quality selector
+// Quality selector — populate with available sources
const qs = document.getElementById('quality-select');
if (qs) {
+ // Clear the HLS-oriented "Auto" default; DASH has discrete sources
+ qs.innerHTML = '';
+
+ // Add pair_sources (video+audio, used by AVMerge)
+ if (data['pair_sources'] && data['pair_sources'].length) {
+ data['pair_sources'].forEach(function(src, i) {
+ let opt = document.createElement('option');
+ opt.value = JSON.stringify({type: 'pair', index: i});
+ opt.textContent = src.quality_string;
+ if (i === data['pair_idx']) opt.selected = true;
+ qs.appendChild(opt);
+ });
+ }
+
+ // Add uni_sources (integrated video+audio, single file)
+ if (data['uni_sources'] && data['uni_sources'].length) {
+ data['uni_sources'].forEach(function(src, i) {
+ let opt = document.createElement('option');
+ opt.value = JSON.stringify({type: 'uni', index: i});
+ opt.textContent = src.quality_string;
+ if (!data['pair_sources'].length && i === data['uni_idx']) opt.selected = true;
+ qs.appendChild(opt);
+ });
+ }
+
qs.addEventListener('change', function(e) {
changeQuality(JSON.parse(this.value))
});