Skip to content

Commit

Permalink
FEC-14226: protect against case where tracks are not ready
Browse files Browse the repository at this point in the history
  • Loading branch information
MosheMaorKaltura committed Dec 9, 2024
1 parent a524539 commit b7756bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,7 @@ export default class Player extends FakeEventTarget {
* @private
*/
private _applyABRRestriction(config: any): void {
if (Utils.Object.hasPropertyPath(config, 'abr.restrictions') && this._engine && this._tracks.length) {
if (Utils.Object.hasPropertyPath(config, 'abr.restrictions') && this._engine && this._tracks?.length) {
const { restrictions } = this._config.abr;
const videoTracks: VideoTrack[] = <VideoTrack[]>this._tracks.filter((track) => track instanceof VideoTrack);
const newVideoTracks = filterTracksByRestriction(videoTracks, restrictions);
Expand Down

0 comments on commit b7756bb

Please sign in to comment.