Skip to content

Commit 6b907d3

Browse files
authored
Merge pull request #5467 from mrpau/hotfix/5464-captions-on-by-default
Captions on by default.
2 parents 153b1aa + 517869f commit 6b907d3

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

docs/installguide/release_notes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ Bug fixes
1717

1818
* Do not rely on ``ifconfig`` removed in Ubuntu 17.04+ :url-issue:`5455`
1919

20+
New Features
21+
^^^^^^^^^^^^
22+
23+
* Enabled captions by default for English dubbed videos. :url-issue:`5464`
24+
2025

2126
0.17.1
2227
------

kalite/distributed/static/js/distributed/base/handlebars.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,12 @@ Handlebars.registerHelper("ifObject", function(candidate, options){
113113
}
114114
});
115115

116+
Handlebars.registerHelper("current_language_is", function(lc, options) {
117+
if(window.sessionModel.get("CURRENT_LANGUAGE") == lc) {
118+
return options.fn(this);
119+
} else {
120+
return options.inverse(this);
121+
}
122+
});
123+
116124
module.exports = Handlebars;

kalite/distributed/static/js/distributed/video/hbtemplates/video-player.handlebars

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<div id="video-player"{{#unless content_urls }} class="client-online-only"{{/unless}}>
22
<video class="video-player video-js vjs-default-skin vjs-fullscreen" id="{{ random_id }}">
33
<source src="{{ content_urls.stream }}" type="{{ content_urls.stream_type }}" />
4-
{{#each subtitle_urls }}
5-
<track kind="captions" src="{{ this.url }}" srclang="{{ code }}" label="{{ name }}" {{#ifcond code "==" ../selected_language }}{{#ifcond ../code "!=" "en" }}default="True"{{/ifcond}}{{/ifcond}}/>
6-
{{/each}}
4+
{{#ifcond translated_youtube_lang "==" "en"}}
5+
{{#each subtitle_urls}}
6+
<track kind="captions" src="{{ this.url }}" srclang="{{ this.code }}" label="{{ this.name }}" {{#current_language_is this.code}}default{{/current_language_is}}/>
7+
{{/each}}
8+
{{/ifcond}}
79
</video>
810
</div>
911

0 commit comments

Comments
 (0)