aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/templates
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2019-11-22 14:56:53 -0800
committerJames Taylor <user234683@users.noreply.github.com>2019-11-22 14:56:53 -0800
commit79d9a18f815a03498e21dd5769a2e70c7ae7afa5 (patch)
tree693376dc5e091f94b5348f1fe51063b1ddc1fc82 /youtube/templates
parent70b56d6eef4fd9d6c46c8fbf48dfec3ae7a2937e (diff)
downloadyt-local-79d9a18f815a03498e21dd5769a2e70c7ae7afa5.tar.lz
yt-local-79d9a18f815a03498e21dd5769a2e70c7ae7afa5.tar.xz
yt-local-79d9a18f815a03498e21dd5769a2e70c7ae7afa5.zip
Extraction: return and display any errors preventing video playback
Diffstat (limited to 'youtube/templates')
-rw-r--r--youtube/templates/watch.html41
1 files changed, 29 insertions, 12 deletions
diff --git a/youtube/templates/watch.html b/youtube/templates/watch.html
index e97b638..da3b336 100644
--- a/youtube/templates/watch.html
+++ b/youtube/templates/watch.html
@@ -14,6 +14,19 @@
text-decoration: underline;
}
+ .playability-error{
+ height: 360px;
+ width: 640px;
+ grid-column: 2;
+ background-color: var(--video-background-color);
+ text-align:center;
+ }
+ .playability-error span{
+ position: relative;
+ top: 50%;
+ transform: translate(-50%, -50%);
+ }
+
{% if theater_mode %}
video{
grid-column: 1 / span 5;
@@ -202,20 +215,24 @@
{% endblock style %}
{% block main %}
- <video controls autofocus>
- {% for video_source in video_sources %}
- <source src="{{ video_source['src'] }}" type="{{ video_source['type'] }}">
- {% endfor %}
+ {% if playability_error %}
+ <div class="playability-error"><span>{{ 'Error: ' + playability_error }}</span></div>
+ {% else %}
+ <video controls autofocus class="video">
+ {% for video_source in video_sources %}
+ <source src="{{ video_source['src'] }}" type="{{ video_source['type'] }}">
+ {% endfor %}
- {% for source in subtitle_sources %}
- {% if source['on'] %}
- <track label="{{ source['label'] }}" src="{{ source['url'] }}" kind="subtitles" srclang="{{ source['srclang'] }}" default>
- {% else %}
- <track label="{{ source['label'] }}" src="{{ source['url'] }}" kind="subtitles" srclang="{{ source['srclang'] }}">
- {% endif %}
- {% endfor %}
+ {% for source in subtitle_sources %}
+ {% if source['on'] %}
+ <track label="{{ source['label'] }}" src="{{ source['url'] }}" kind="subtitles" srclang="{{ source['srclang'] }}" default>
+ {% else %}
+ <track label="{{ source['label'] }}" src="{{ source['url'] }}" kind="subtitles" srclang="{{ source['srclang'] }}">
+ {% endif %}
+ {% endfor %}
- </video>
+ </video>
+ {% endif %}
<div class="video-info">
<h2 class="title">{{ title }}</h2>