summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com>2021-02-25 17:54:28 +0100
committerGitHub <noreply@github.com>2021-02-25 17:54:28 +0100
commit0b2109576a0730e3f5e3b8af77d1d9c50e97ae21 (patch)
tree5bc04981db035888e1ce3facb7653e4923e45b76 /src
parentc8cdc50d29a7a6684314bc5e53fc328c7d3f85c3 (diff)
parent9b79e35d5280e7c7586e44d18930267f7e5237b6 (diff)
downloadinvidious-0b2109576a0730e3f5e3b8af77d1d9c50e97ae21.tar.gz
invidious-0b2109576a0730e3f5e3b8af77d1d9c50e97ae21.tar.bz2
invidious-0b2109576a0730e3f5e3b8af77d1d9c50e97ae21.zip
Merge pull request #1804 from tenpura-shrimp/captionpreload
do not preload captions
Diffstat (limited to 'src')
-rw-r--r--src/invidious/views/components/player.ecr7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/invidious/views/components/player.ecr b/src/invidious/views/components/player.ecr
index a898a41f..cff3e60a 100644
--- a/src/invidious/views/components/player.ecr
+++ b/src/invidious/views/components/player.ecr
@@ -24,9 +24,9 @@
<% end %>
<% end %>
- <% preferred_captions.each_with_index do |caption, i| %>
+ <% preferred_captions.each do |caption| %>
<track kind="captions" src="/api/v1/captions/<%= video.id %>?label=<%= caption.name.simpleText %>&hl=<%= env.get("preferences").as(Preferences).locale %>"
- label="<%= caption.name.simpleText %>" <% if i == 0 %>default<% end %>>
+ label="<%= caption.name.simpleText %>">
<% end %>
<% captions.each do |caption| %>
@@ -42,7 +42,8 @@
"aspect_ratio" => aspect_ratio,
"title" => video.title,
"description" => HTML.escape(video.short_description),
- "thumbnail" => thumbnail
+ "thumbnail" => thumbnail,
+ "preferred_caption_found" => !preferred_captions.empty?
}.to_pretty_json
%>
</script>