Skip to content

Commit

Permalink
fix: Fix EOS set-top box being identified as Apple. (shaka-project#4310)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matvp91 authored Jun 22, 2022
1 parent 713f461 commit 7c2c4be
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/util/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand Down Expand Up @@ -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).
*
Expand Down

0 comments on commit 7c2c4be

Please sign in to comment.