Skip to content

Commit

Permalink
Update audio-track-controller.ts (#5431)
Browse files Browse the repository at this point in the history
Sometimes STABLE-RENDITION_ID of tracks is undefined. Adding a guard for it, otherwise audio track doesn't switch.
  • Loading branch information
agajassi authored Apr 28, 2023
1 parent 163442d commit 8d142ec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/controller/audio-track-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,9 @@ class AudioTrackController extends BasePlaylistController {
if (!this.selectDefaultTrack || track.default) {
if (
!currentTrack ||
currentTrack.attrs['STABLE-RENDITION-ID'] ===
track.attrs['STABLE-RENDITION-ID']
(currentTrack.attrs['STABLE-RENDITION-ID'] !== undefined &&
currentTrack.attrs['STABLE-RENDITION-ID'] ===
track.attrs['STABLE-RENDITION-ID'])
) {
return track.id;
}
Expand Down

0 comments on commit 8d142ec

Please sign in to comment.