Skip to content

Commit 0dd89fe

Browse files
committed
missing chooseCodecsAndFilterManifest selecting audio and updating variant after changing layer
1 parent 8c34b33 commit 0dd89fe

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

lib/player.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1919,7 +1919,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
19191919

19201920
// If the content is multi-codec and the browser can play more than one of
19211921
// them, choose codecs now before we initialize streaming.
1922-
shaka.util.StreamUtils.chooseCodecsAndFilterManifest(
1922+
shaka.util.StreamUtils.chooseCodecsAndFilterManifest(
19231923
this.manifest_,
19241924
this.config_.preferredVideoCodecs,
19251925
this.config_.preferredAudioCodecs,
@@ -4194,9 +4194,16 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
41944194
Math.abs((a.video.width || 0) - (b.video.width || 0));
41954195
}
41964196
};
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.
42004207
const active = this.streamingEngine_.getCurrentVariant();
42014208
const set =
42024209
this.currentAdaptationSetCriteria_.create(this.manifest_.variants);
@@ -5865,6 +5872,12 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
58655872
return false;
58665873
}
58675874

5875+
shaka.util.StreamUtils.chooseCodecsAndFilterManifest(
5876+
this.manifest_,
5877+
this.config_.preferredVideoCodecs,
5878+
this.config_.preferredAudioCodecs,
5879+
this.config_.preferredDecodingAttributes);
5880+
58685881
const playableVariants = shaka.util.StreamUtils.getPlayableVariants(
58695882
this.manifest_.variants);
58705883

0 commit comments

Comments
 (0)