Skip to content

Commit

Permalink
fix(DRM): Fix drm choice when the user provide a server in the manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed Feb 12, 2025
1 parent 0400d1e commit 3b8deb8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/drm/drm_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,17 @@ shaka.drm.DrmEngine = class {

// If we have configured preferredKeySystems, choose a preferred keySystem
// if available.
for (const preferredKeySystem of this.config_.preferredKeySystems) {
let preferredKeySystems = this.config_.preferredKeySystems;
if (!preferredKeySystems.length) {
// If there is no preference set and we only have one server license, we
// use this as preference. This is used to override manifests on those
// that have the embedded license and the browser supports multiple DRMs.
const servers = shaka.util.MapUtils.asMap(this.config_.servers);
if (servers.size == 1) {
preferredKeySystems = servers.keys();
}
}
for (const preferredKeySystem of preferredKeySystems) {
for (const variant of variants) {
const decodingInfo = variant.decodingInfos.find((decodingInfo) => {
return decodingInfo.supported &&
Expand Down

0 comments on commit 3b8deb8

Please sign in to comment.