Skip to content

Commit

Permalink
feat: Change default preferredKeySystems for Xbox and PS4 (#6471)
Browse files Browse the repository at this point in the history
Related to #6468
  • Loading branch information
avelad authored Apr 24, 2024
1 parent 0883c32 commit cff3d84
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion externs/shaka/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,8 @@ shaka.extern.PersistentSessionMetadata;
* <i>Defaults to 1.</i> <br>
* The frequency in seconds with which to check the expiration of a session.
* @property {!Array.<string>} preferredKeySystems
* <i>Defaults to an empty array. </i> <br>
* <i>Defaults ['com.microsoft.playready'] on Xbox One and PlayStation 4, and
* an empty array for all other browsers.</i> <br>
* Specifies the priorties of available DRM key systems.
* @property {Object.<string, string>} keySystemsMapping
* A map of key system name to key system name.
Expand Down
7 changes: 7 additions & 0 deletions lib/util/player_configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ shaka.util.PlayerConfiguration = class {
ignoreDuplicateInitData: !shaka.util.Platform.isTizen2(),
};

// The Xbox One and PS4 only support the Playready DRM, so they should
// prefer that key system by default to improve startup performance.
if (shaka.util.Platform.isXboxOne() ||
shaka.util.Platform.isPS4()) {
drm.preferredKeySystems.push('com.microsoft.playready');
}

let codecSwitchingStrategy = shaka.config.CodecSwitchingStrategy.RELOAD;
let multiTypeVariantsAllowed = false;
if (shaka.util.Platform.supportsSmoothCodecSwitching()) {
Expand Down

0 comments on commit cff3d84

Please sign in to comment.