From 4dce1e0ba5988e21dbf70490ae32819fe6433632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Sat, 21 Aug 2021 02:21:35 +0200 Subject: [PATCH] Fix: Always polyfill MediaCapabilities for Apple browsers (#3588) --- lib/polyfill/media_capabilities.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/polyfill/media_capabilities.js b/lib/polyfill/media_capabilities.js index 211a1311c2..fb977a51f6 100644 --- a/lib/polyfill/media_capabilities.js +++ b/lib/polyfill/media_capabilities.js @@ -27,7 +27,14 @@ shaka.polyfill.MediaCapabilities = class { // Since MediaCapabilities is not fully supported on Chromecast yet, we // should always install polyfill for Chromecast. // TODO: re-evaluate MediaCapabilities in the future versions of Chromecast. - if (!shaka.util.Platform.isChromecast() && navigator.mediaCapabilities) { + // Since MediaCapabilities implementation is buggy in Apple browsers, we + // should always install polyfill for Apple browsers. + // See: https://github.com/google/shaka-player/issues/3530 + // TODO: re-evaluate MediaCapabilities in the future versions of Apple + // Browsers. + if (!shaka.util.Platform.isChromecast() && + !shaka.util.Platform.isApple() && + navigator.mediaCapabilities) { shaka.log.debug( 'MediaCapabilities: Native mediaCapabilities support found.'); return;