Skip to content

Commit

Permalink
fix: Use audio label on ExampleBasedCriteria (#7971)
Browse files Browse the repository at this point in the history
Fixes #7968

---------

Co-authored-by: Wojciech Tyczyński <[email protected]>
  • Loading branch information
avelad and tykus160 authored Jan 29, 2025
1 parent 20ed3b0 commit b491e4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/media/example_based_criteria.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ shaka.media.ExampleBasedCriteria = class {
* } adaptationSetCriteriaFactory
*/
constructor(example, codecSwitchingStrategy, adaptationSetCriteriaFactory) {
// We can't know if role and label are really important, so we don't use
// role and label for this.
// We can't know if role and video label are really important, so we don't
// use role and video label for this.
const role = '';
const audioLabel = '';
const audioLabel = example.audio && example.audio.label ?
example.audio.label : '';
const videoLabel = '';
const hdrLevel = example.video && example.video.hdr ?
example.video.hdr : '';
Expand Down
3 changes: 2 additions & 1 deletion lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -5187,7 +5187,8 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
if (this.config_.abr.enabled && (active.video != variant.video ||
(active.audio && variant.audio &&
active.audio.language == variant.audio.language &&
active.audio.channelsCount == variant.audio.channelsCount))) {
active.audio.channelsCount == variant.audio.channelsCount &&
active.audio.label == variant.audio.label))) {
shaka.log.alwaysWarn('Changing tracks while abr manager is enabled ' +
'will likely result in the selected track ' +
'being overridden. Consider disabling abr ' +
Expand Down

0 comments on commit b491e4a

Please sign in to comment.