mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-20 03:48:52 +00:00
Merge pull request #91 from omarroth/add-preferred-captions
Add preferred captions
This commit is contained in:
@@ -55,7 +55,7 @@ video, #my_video, .video-js, .vjs-default-skin
|
||||
<% end %>
|
||||
<% captions.each do |caption| %>
|
||||
<track kind="captions" src="/api/v1/captions/<%= video.id %>?label=<%= caption["name"]["simpleText"] %>"
|
||||
srclang="<%= caption["languageCode"] %>" label="<%= caption["name"]["simpleText"]%> ">
|
||||
label="<%= caption["name"]["simpleText"]%> ">
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -56,6 +56,30 @@ function update_value(element) {
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="pure-control-group">
|
||||
<label for="captions_0">Default captions: </label>
|
||||
<select class="pure-u-1-5" name="captions_0" id="captions_0">
|
||||
<% CAPTION_LANGUAGES.each do |option| %>
|
||||
<option <% if user.preferences.captions[0] == option %> selected <% end %>><%= option %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="pure-control-group">
|
||||
<label for="captions_fallback">Fallback languages: </label>
|
||||
<select class="pure-u-1-5" name="captions_1" id="captions_1">
|
||||
<% CAPTION_LANGUAGES.each do |option| %>
|
||||
<option <% if user.preferences.captions[1] == option %> selected <% end %>><%= option %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
|
||||
<select class="pure-u-1-5" name="captions_2" id="captions_2">
|
||||
<% CAPTION_LANGUAGES.each do |option| %>
|
||||
<option <% if user.preferences.captions[2] == option %> selected <% end %>><%= option %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<legend>Visual preferences</legend>
|
||||
<div class="pure-control-group">
|
||||
<label for="dark_mode">Dark mode: </label>
|
||||
|
||||
@@ -60,9 +60,14 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% preferred_captions.each_with_index do |caption, i| %>
|
||||
<track kind="captions" src="/api/v1/captions/<%= video.id %>?label=<%= caption["name"]["simpleText"] %>"
|
||||
label="<%= caption["name"]["simpleText"]%>" <% if i == 0 %>default<% end %>>
|
||||
<% end %>
|
||||
|
||||
<% captions.each do |caption| %>
|
||||
<track kind="captions" src="/api/v1/captions/<%= video.id %>?label=<%= caption["name"]["simpleText"] %>"
|
||||
srclang="<%= caption["languageCode"] %>" label="<%= caption["name"]["simpleText"]%> ">
|
||||
label="<%= caption["name"]["simpleText"]%>">
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user