diff --git a/lib/player.js b/lib/player.js index 8e16bccb9b..d59ed99c23 100644 --- a/lib/player.js +++ b/lib/player.js @@ -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, @@ -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); @@ -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);