Skip to content

Commit

Permalink
Merge pull request #23 from clappr/fix-cc-options
Browse files Browse the repository at this point in the history
Closed Captions - Simplify binds on the core instance
  • Loading branch information
jhonatangcavalcanti authored Nov 13, 2020
2 parents dde8186 + 4e95fe7 commit bd2902f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .hound.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
java_script:
eslint:
enabled: true
config_file: .eslintrc.js
config_file: .eslintrc.json
15 changes: 4 additions & 11 deletions src/plugins/closed_captions/closed_captions.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,11 @@ export default class ClosedCaptions extends UICorePlugin {
}

bindEvents() {
this.bindCoreEvents()
this.bindContainerEvents()
}
this.listenTo(this.core, Events.CORE_ACTIVE_CONTAINER_CHANGED, this.containerChanged)
this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_RENDERED, this.render)
this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_HIDE, this.hideContextMenu)

bindCoreEvents() {
if (this.core.mediaControl.settings) {
this.listenTo(this.core, Events.CORE_ACTIVE_CONTAINER_CHANGED, this.containerChanged)
this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_RENDERED, this.render)
this.listenTo(this.core.mediaControl, Events.MEDIACONTROL_HIDE, this.hideContextMenu)
} else {
setTimeout(() => this.bindCoreEvents(), 100)
}
this.bindContainerEvents()
}

bindContainerEvents() {
Expand Down

0 comments on commit bd2902f

Please sign in to comment.