mirror of
https://github.com/iv-org/invidious.git
synced 2024-08-23 04:40:43 +02:00
Merge pull request #1804 from tenpura-shrimp/captionpreload
do not preload captions
This commit is contained in:
commit
0b2109576a
@ -21,6 +21,7 @@ var options = {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
html5: {
|
html5: {
|
||||||
|
preloadTextTracks: false,
|
||||||
hls: {
|
hls: {
|
||||||
overrideNative: true
|
overrideNative: true
|
||||||
}
|
}
|
||||||
@ -547,3 +548,10 @@ window.addEventListener('keydown', e => {
|
|||||||
if (player.share) {
|
if (player.share) {
|
||||||
player.share(shareOptions);
|
player.share(shareOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// show the preferred caption by default
|
||||||
|
if (player_data.preferred_caption_found) {
|
||||||
|
player.ready(() => {
|
||||||
|
player.textTracks()[1].mode = 'showing';
|
||||||
|
});
|
||||||
|
}
|
@ -24,9 +24,9 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<% 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 %>"
|
<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 %>
|
<% end %>
|
||||||
|
|
||||||
<% captions.each do |caption| %>
|
<% captions.each do |caption| %>
|
||||||
@ -42,7 +42,8 @@
|
|||||||
"aspect_ratio" => aspect_ratio,
|
"aspect_ratio" => aspect_ratio,
|
||||||
"title" => video.title,
|
"title" => video.title,
|
||||||
"description" => HTML.escape(video.short_description),
|
"description" => HTML.escape(video.short_description),
|
||||||
"thumbnail" => thumbnail
|
"thumbnail" => thumbnail,
|
||||||
|
"preferred_caption_found" => !preferred_captions.empty?
|
||||||
}.to_pretty_json
|
}.to_pretty_json
|
||||||
%>
|
%>
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user