aboutsummaryrefslogtreecommitdiffstats
path: root/youtube
diff options
context:
space:
mode:
Diffstat (limited to 'youtube')
-rw-r--r--youtube/static/js/plyr-start.js4
-rw-r--r--youtube/templates/embed.html6
2 files changed, 6 insertions, 4 deletions
diff --git a/youtube/static/js/plyr-start.js b/youtube/static/js/plyr-start.js
index 49b9f14..dae001a 100644
--- a/youtube/static/js/plyr-start.js
+++ b/youtube/static/js/plyr-start.js
@@ -120,5 +120,7 @@ const player = new Plyr(document.getElementById('js-video-player'), {
// Hide the external quality selector
window.addEventListener('DOMContentLoaded', function(){
- document.getElementById('quality-select').hidden = true;
+ var qs = document.getElementById('quality-select');
+ if (qs)
+ qs.hidden = true;
});
diff --git a/youtube/templates/embed.html b/youtube/templates/embed.html
index 46d58fe..026afb1 100644
--- a/youtube/templates/embed.html
+++ b/youtube/templates/embed.html
@@ -37,9 +37,9 @@
<body>
<video id="js-video-player" controls autofocus onmouseleave="{{ title }}"
oncontextmenu="{{ title }}" onmouseenter="{{ title }}" title="{{ title }}">
- {% for video_source in video_sources %}
- <source src="{{ video_source['src'] }}" type="{{ video_source['type'] }}">
- {% 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'] %}
<track label="{{ source['label'] }}" src="{{ source['url'] }}" kind="subtitles" srclang="{{ source['srclang'] }}" default>