@@ -1919,7 +1919,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
1919
1919
1920
1920
// If the content is multi-codec and the browser can play more than one of
1921
1921
// them, choose codecs now before we initialize streaming.
1922
- shaka . util . StreamUtils . chooseCodecsAndFilterManifest (
1922
+ shaka . util . StreamUtils . chooseCodecsAndFilterManifest (
1923
1923
this . manifest_ ,
1924
1924
this . config_ . preferredVideoCodecs ,
1925
1925
this . config_ . preferredAudioCodecs ,
@@ -4194,9 +4194,16 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
4194
4194
Math . abs ( ( a . video . width || 0 ) - ( b . video . width || 0 ) ) ;
4195
4195
}
4196
4196
} ;
4197
- // Find the variant whose size is closest to the active variant. This
4198
- // ensures we stay at about the same resolution when just changing the
4199
- // language/role.
4197
+
4198
+ shaka . util . StreamUtils . chooseCodecsAndFilterManifest (
4199
+ this . manifest_ ,
4200
+ this . config_ . preferredVideoCodecs ,
4201
+ this . config_ . preferredAudioCodecs ,
4202
+ this . config_ . preferredDecodingAttributes ) ;
4203
+
4204
+ // Find the variant whose size is closest to the active variant. This
4205
+ // ensures we stay at about the same resolution when just changing the
4206
+ // language/role.
4200
4207
const active = this . streamingEngine_ . getCurrentVariant ( ) ;
4201
4208
const set =
4202
4209
this . currentAdaptationSetCriteria_ . create ( this . manifest_ . variants ) ;
@@ -5865,6 +5872,12 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
5865
5872
return false ;
5866
5873
}
5867
5874
5875
+ shaka . util . StreamUtils . chooseCodecsAndFilterManifest (
5876
+ this . manifest_ ,
5877
+ this . config_ . preferredVideoCodecs ,
5878
+ this . config_ . preferredAudioCodecs ,
5879
+ this . config_ . preferredDecodingAttributes ) ;
5880
+
5868
5881
const playableVariants = shaka . util . StreamUtils . getPlayableVariants (
5869
5882
this . manifest_ . variants ) ;
5870
5883
0 commit comments