Skip to content

Commit

Permalink
stream-controller: check audio codec is defined before comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
jprjr committed Jul 5, 2022
1 parent 0561b3d commit b7ffa46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controller/stream-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ export default class StreamController
}
}
// HE-AAC is broken on Android, always signal audio codec as AAC even if variant manifest states otherwise
if (audioCodec.indexOf('mp4a.40.5') !== -1) {
if (audioCodec && audioCodec.indexOf('mp4a.40.5') !== -1) {
if (ua.indexOf('android') !== -1 && audio.container !== 'audio/mpeg') {
// Exclude mpeg audio
audioCodec = 'mp4a.40.2';
Expand Down

0 comments on commit b7ffa46

Please sign in to comment.