Skip to content

Commit

Permalink
fix(FEC-12527): turning on hls debug mode in config causes the player…
Browse files Browse the repository at this point in the history
… to crash (#176)

In some cases hls.js triggers our event handlers (specifically _onAudioTrackSwitched) before the _onManifestLoaded handler. When _onAudioTracksSwitched calls _playerTracks.find, which is undefined, it crashes.
The solution is to initialize _playerTracks with an empty array before _onManifestLoaded fills it with the real values.
  • Loading branch information
SivanA-Kaltura authored Sep 4, 2022
1 parent bcb5ab2 commit 78793b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hls-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default class HlsAdapter extends BaseMediaSourceAdapter {
* @type {Array<Track>}
* @private
*/
_playerTracks: Array<Track>;
_playerTracks: Array<Track> = [];
/**
* stream start time in seconds
* @type {?number}
Expand Down

0 comments on commit 78793b4

Please sign in to comment.