aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/templates/watch.html
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2021-08-17 17:58:17 -0700
committerJesús <heckyel@hyperbola.info>2021-08-29 18:48:56 -0500
commitc9a75042d24ed969e0cf5ae0d7b76ccb3c41a93b (patch)
tree2083e8db6f479676a969fe13bda3a6c9cfcbc114 /youtube/templates/watch.html
parente4af99fd178c39b584001fa1b7d6d62d88bc7a60 (diff)
downloadyt-local-c9a75042d24ed969e0cf5ae0d7b76ccb3c41a93b.tar.lz
yt-local-c9a75042d24ed969e0cf5ae0d7b76ccb3c41a93b.tar.xz
yt-local-c9a75042d24ed969e0cf5ae0d7b76ccb3c41a93b.zip
Add support for more qualities, merging video+audio using MSE
Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'youtube/templates/watch.html')
-rw-r--r--youtube/templates/watch.html12
1 files changed, 8 insertions, 4 deletions
diff --git a/youtube/templates/watch.html b/youtube/templates/watch.html
index 2b19aeb..9d7a36c 100644
--- a/youtube/templates/watch.html
+++ b/youtube/templates/watch.html
@@ -29,7 +29,7 @@
{% endif %}
</span>
</div>
- {% elif (video_sources.__len__() == 0 or live) and hls_formats.__len__() != 0 %}
+ {% elif (uni_sources.__len__() == 0 or live) and hls_formats.__len__() != 0 %}
<div class="live-url-choices">
<span>Copy a url into your video player:</span>
<ol>
@@ -41,9 +41,9 @@
{% else %}
<figure class="sc-video">
<video id="js-video-player" playsinline controls>
- {% for video_source in video_sources %}
- <source src="{{ video_source['src'] }}" type="{{ video_source['type'] }}" data-res="{{ video_source['quality'] }}">
- {% endfor %}
+ {% if uni_sources %}
+ <source src="{{ uni_sources[uni_idx]['url'] }}" type="{{ uni_sources[uni_idx]['type'] }}" data-res="{{ uni_sources[uni_idx]['quality'] }}">
+ {% endif %}
{% for source in subtitle_sources %}
{% if source['on'] %}
@@ -55,6 +55,10 @@
</video>
</figure>
+ {% if pair_sources and (not uni_sources or pair_sources[pair_idx][0]['quality'] != uni_sources[uni_idx]['quality']) %}
+ <script src="/youtube.com/static/js/av-merge.js"></script>
+ {% endif %}
+
{% if time_start != 0 %}
<script>
document.getElementById('js-video-player').currentTime = {{ time_start|tojson }};