diff --git a/lib/polyfill/media_capabilities.js b/lib/polyfill/media_capabilities.js index 6aec26c9cb..85dc1c06b6 100644 --- a/lib/polyfill/media_capabilities.js +++ b/lib/polyfill/media_capabilities.js @@ -34,8 +34,14 @@ shaka.polyfill.MediaCapabilities = class { // See: https://github.com/google/shaka-player/issues/3530 // TODO: re-evaluate MediaCapabilities in the future versions of Apple // Browsers. + // Since MediaCapabilities implementation is buggy in PS5 browsers, we + // should always install polyfill for PS5 browsers. + // See: https://github.com/google/shaka-player/issues/3582 + // TODO: re-evaluate MediaCapabilities in the future versions of PS5 + // Browsers. if (!shaka.util.Platform.isChromecast() && !shaka.util.Platform.isApple() && + !shaka.util.Platform.isPS5() && navigator.mediaCapabilities) { shaka.log.debug( 'MediaCapabilities: Native mediaCapabilities support found.'); @@ -149,7 +155,7 @@ shaka.polyfill.MediaCapabilities = class { sessionTypes: mediaCapkeySystemConfig.sessionTypes, }; - // Only add the audio video capablities if they have valid data. + // Only add the audio video capabilities if they have valid data. // Otherwise the query will fail. if (audioCapabilities.length) { mediaKeySystemConfig.audioCapabilities = audioCapabilities; diff --git a/lib/util/platform.js b/lib/util/platform.js index 85695f7d13..040c547868 100644 --- a/lib/util/platform.js +++ b/lib/util/platform.js @@ -163,7 +163,6 @@ shaka.util.Platform = class { !shaka.util.Platform.isEdge(); } - /** * Check if the current platform is from Apple. * @@ -179,6 +178,19 @@ shaka.util.Platform = class { && !shaka.util.Platform.isTizen(); } + /** + * Check if the current platform is Playstation 5. + * + * Returns true on Playstation 5 browsers. + * + * Returns false for Playstation 5 browsers + * + * @return {boolean} + */ + static isPS5() { + return shaka.util.Platform.userAgentContains_('PlayStation 5'); + } + /** * Returns a major version number for Safari, or Safari-based iOS browsers. *