Skip to content

Commit

Permalink
missing chooseCodecsAndFilterManifest selecting audio and updating va…
Browse files Browse the repository at this point in the history
…riant after changing layer
  • Loading branch information
jobispo committed Nov 21, 2024
1 parent 8c34b33 commit 0dd89fe
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -1919,7 +1919,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {

// If the content is multi-codec and the browser can play more than one of
// them, choose codecs now before we initialize streaming.
shaka.util.StreamUtils.chooseCodecsAndFilterManifest(
shaka.util.StreamUtils.chooseCodecsAndFilterManifest(
this.manifest_,
this.config_.preferredVideoCodecs,
this.config_.preferredAudioCodecs,
Expand Down Expand Up @@ -4194,9 +4194,16 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
Math.abs((a.video.width || 0) - (b.video.width || 0));
}
};
// Find the variant whose size is closest to the active variant. This
// ensures we stay at about the same resolution when just changing the
// language/role.

shaka.util.StreamUtils.chooseCodecsAndFilterManifest(
this.manifest_,
this.config_.preferredVideoCodecs,
this.config_.preferredAudioCodecs,
this.config_.preferredDecodingAttributes);

// Find the variant whose size is closest to the active variant. This
// ensures we stay at about the same resolution when just changing the
// language/role.
const active = this.streamingEngine_.getCurrentVariant();
const set =
this.currentAdaptationSetCriteria_.create(this.manifest_.variants);
Expand Down Expand Up @@ -5865,6 +5872,12 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
return false;
}

shaka.util.StreamUtils.chooseCodecsAndFilterManifest(
this.manifest_,
this.config_.preferredVideoCodecs,
this.config_.preferredAudioCodecs,
this.config_.preferredDecodingAttributes);

const playableVariants = shaka.util.StreamUtils.getPlayableVariants(
this.manifest_.variants);

Expand Down

0 comments on commit 0dd89fe

Please sign in to comment.