Skip to content

Commit

Permalink
FEC-14226: protect against case where tracks are not ready (#801)
Browse files Browse the repository at this point in the history
### Description of the Changes

Please add a detailed description of the change, whether it's an
enhancement or a bugfix.
If the PR is related to an open issue please link to it.

### CheckLists

- [ ] changes have been done against master branch, and PR does not
conflict
- [ ] new unit / functional tests have been added (whenever applicable)
- [ ] test are passing in local environment
- [ ] Travis tests are passing (or test results are not worse than on
master branch :))
- [ ] Docs have been updated
  • Loading branch information
MosheMaorKaltura authored Dec 9, 2024
1 parent a524539 commit afb5939
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 afb5939

Please sign in to comment.