Skip to content

Commit

Permalink
Merge pull request #5467 from mrpau/hotfix/5464-captions-on-by-default
Browse files Browse the repository at this point in the history
Captions on by default.
  • Loading branch information
benjaoming committed Jun 6, 2017
2 parents 153b1aa + 517869f commit 6b907d3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions docs/installguide/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ Bug fixes

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

New Features
^^^^^^^^^^^^

* Enabled captions by default for English dubbed videos. :url-issue:`5464`


0.17.1
------
Expand Down
8 changes: 8 additions & 0 deletions kalite/distributed/static/js/distributed/base/handlebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,12 @@ Handlebars.registerHelper("ifObject", function(candidate, options){
}
});

Handlebars.registerHelper("current_language_is", function(lc, options) {
if(window.sessionModel.get("CURRENT_LANGUAGE") == lc) {
return options.fn(this);
} else {
return options.inverse(this);
}
});

module.exports = Handlebars;
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<div id="video-player"{{#unless content_urls }} class="client-online-only"{{/unless}}>
<video class="video-player video-js vjs-default-skin vjs-fullscreen" id="{{ random_id }}">
<source src="{{ content_urls.stream }}" type="{{ content_urls.stream_type }}" />
{{#each subtitle_urls }}
<track kind="captions" src="{{ this.url }}" srclang="{{ code }}" label="{{ name }}" {{#ifcond code "==" ../selected_language }}{{#ifcond ../code "!=" "en" }}default="True"{{/ifcond}}{{/ifcond}}/>
{{/each}}
{{#ifcond translated_youtube_lang "==" "en"}}
{{#each subtitle_urls}}
<track kind="captions" src="{{ this.url }}" srclang="{{ this.code }}" label="{{ this.name }}" {{#current_language_is this.code}}default{{/current_language_is}}/>
{{/each}}
{{/ifcond}}
</video>
</div>

Expand Down

0 comments on commit 6b907d3

Please sign in to comment.