From 7c2c4be2ae946c4cf270717f852b0d95b498266e Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 22 Jun 2022 23:36:25 +0200 Subject: [PATCH] fix: Fix EOS set-top box being identified as Apple. (#4310) The EOS set-top box, built by Liberty Global, has WebKit embedded and should play MSE (+ EME) compatible streams. With the latest version (`4`), streams didn't play. When attaching a debugger to the box, I noticed that the srcEquals node is selected. The EOS box identifies itself as an Apple device, which is wrong. `Platform.isApple()` returns true, therefore `shouldUseSrcEquals_` (in combination with `config_.streaming.useNativeHlsOnSafari`) returns true as-well. The native playback check is not holding it from selecting srcEquals (https://github.com/shaka-project/shaka-player/blob/main/lib/player.js#L1273) as EOS supports MPEG-DASH natively (but not in combination with DRM, as far as I know). Nonetheless, MSE is preferred. --- lib/util/platform.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/util/platform.js b/lib/util/platform.js index 92f63e5e12..04529bffd7 100644 --- a/lib/util/platform.js +++ b/lib/util/platform.js @@ -197,7 +197,8 @@ shaka.util.Platform = class { */ static isApple() { return !!navigator.vendor && navigator.vendor.includes('Apple') && - !shaka.util.Platform.isTizen(); + !shaka.util.Platform.isTizen() && + !shaka.util.Platform.isEOS(); } /** @@ -260,6 +261,15 @@ shaka.util.Platform = class { return !!shaka.util.Platform.safariVersion(); } + /** + * Check if the current platform is an EOS set-top box. + * + * @return {boolean} + */ + static isEOS() { + return shaka.util.Platform.userAgentContains_('PC=EOS'); + } + /** * Guesses if the platform is a mobile one (iOS or Android). *