diff --git a/src/plugins/closed_captions/closed_captions.js b/src/plugins/closed_captions/closed_captions.js index df13b34f5..a0c5db180 100644 --- a/src/plugins/closed_captions/closed_captions.js +++ b/src/plugins/closed_captions/closed_captions.js @@ -96,13 +96,11 @@ export default class ClosedCaptions extends UICorePlugin { } setCurrentContextMenuElement(trackId) { - if (this._trackId !== trackId) { - this.contextMenuElement().removeClass('current') - this.contextMenuElement(trackId).addClass('current') - const method = trackId > -1 ? 'addClass' : 'removeClass' - this.$ccButton[method]('enabled') - this._trackId = trackId - } + this.contextMenuElement().removeClass('current') + this.contextMenuElement(trackId).addClass('current') + const method = trackId > -1 ? 'addClass' : 'removeClass' + this.$ccButton[method]('enabled') + this._trackId = trackId } renderCcButton() { @@ -121,6 +119,9 @@ export default class ClosedCaptions extends UICorePlugin { this.$ccButton = this.$el.find('button.cc-button[data-cc-button]') this.$ccButton.append(ccIcon) this.$el.append(this.style) + + if (this.container) + this.setCurrentContextMenuElement(this.container.closedCaptionsTrackId) } render() { diff --git a/src/plugins/closed_captions/public/closed_captions.html b/src/plugins/closed_captions/public/closed_captions.html index 544e71330..7c3305436 100644 --- a/src/plugins/closed_captions/public/closed_captions.html +++ b/src/plugins/closed_captions/public/closed_captions.html @@ -5,6 +5,6 @@ <% }; %>
  • <%= disabledLabel %>
  • <% for (var i = 0; i < tracks.length; i++) { %> -
  • <%= tracks[i].label %>
  • +
  • <%= tracks[i].label %><%= tracks[i].attributes && tracks[i].attributes.forced ? ' (forced)' : '' %>
  • <% }; %>