Skip to content

Commit

Permalink
feat: create unbindCustomListeners method
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopaulovieira committed May 13, 2021
1 parent 4c6508d commit 29d8415
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/hls.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,16 @@ export default class HlsjsPlayback extends HTML5Video {
HLSJS.Events[`${requestedEventName}`] && this._hls[`${typeOfListener}`](HLSJS.Events[`${requestedEventName}`], item.callback)
})
}

unbindCustomListeners() {
this.options.hlsPlayback &&
this.options.hlsPlayback.customListeners &&
this.options.hlsPlayback.customListeners.forEach(item => {
const requestedEventName = item.eventName
HLSJS.Events[`${requestedEventName}`] && this._hls.off(HLSJS.Events[`${requestedEventName}`], item.callback)
})
}

_onFragmentParsingMetadata(evt, data) {
this.trigger(Events.Custom.PLAYBACK_FRAGMENT_PARSING_METADATA, { evt, data })
}
Expand Down

0 comments on commit 29d8415

Please sign in to comment.