Skip to content

Commit

Permalink
Updates for #54
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertPeek committed Sep 7, 2022
1 parent 92982ff commit ad84234
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ The Icon popup attribute group contains values for **_isEnabled**, **_classes**,
No known limitations.

----------------------------
**Version number:** 4.4.0
**Version number:** 4.4.1
**Framework versions supported:** 5.8+
**Author / maintainer:** DeltaNet with [contributors](https://github.com/deltanet/adapt-icon-popup/graphs/contributors)
**Accessibility support:** Yes
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adapt-icon-popup",
"version": "4.4.0",
"version": "4.4.1",
"framework": ">=5.8",
"homepage": "https://github.com/deltanet/adapt-icon-popup",
"issues": "https://github.com/deltanet/adapt-icon-popup/issues",
Expand Down
34 changes: 20 additions & 14 deletions js/popupView.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,31 @@ export default class PopupView extends Backbone.View {
this.audioId = this.model.get('audioId');
}

this.listenTo(Adapt, {
'media:stop': this.onMediaStop,
'audio:updateAudioStatus': this.setVideoVolume
});
// Video
if (this.model.get('_video') && this.model.get('_video')._media.cc) {
this.listenTo(Adapt, {
'remove': this.onRemove,
'media:stop': this.onMediaStop,
'audio:updateAudioStatus': this.setVideoVolume
});

_.bindAll(this, 'onMediaElementPlay', 'onMediaElementPause', 'onMediaElementEnded', 'onMediaElementTimeUpdate', 'onMediaElementSeeking');
_.bindAll(this, 'onMediaElementPlay', 'onMediaElementPause', 'onMediaElementEnded', 'onMediaElementTimeUpdate', 'onMediaElementSeeking');

// set initial player state attributes
this.model.set({
'_isMediaEnded': false,
'_isMediaPlaying': false
});
// set initial player state attributes
this.model.set({
'_isMediaEnded': false,
'_isMediaPlaying': false
});
}

this.render();
}

onOpened() {
this.setupPlayer();
this.addMejsButtonClass();
if (this.model.get('_video') && this.model.get('_video')._media.cc) {
this.setupPlayer();
this.addMejsButtonClass();
}

if (!this.audioIsEnabled) return;

Expand Down Expand Up @@ -312,11 +318,11 @@ export default class PopupView extends Backbone.View {
if(!isPaused) player.pause();
}

remove() {
onRemove() {
this.$('.mejs-overlay-button').off("click", this.onOverlayClick);
this.$('.mejs-mediaelement').off("click", this.onMediaElementClick);

if(this.model.get('_video')._media.cc) {
if (this.model.get('_video')._media.cc) {
this.$('.mejs-captions-button button').off('click.mediaCaptionsChange');
}

Expand Down

0 comments on commit ad84234

Please sign in to comment.