Skip to content

Commit

Permalink
fix: 4676 - Virgin Media set top box is incorrectly categorized as Ap…
Browse files Browse the repository at this point in the history
…ple/Safari (#4678)

In order to get the playback working, I am excluding VirginMedia device
from isApple() platform test, otherwise it incorrectly fails at
isBrowserSupported().

Fixes #4676

Co-authored-by: Casey Occhialini <1508707+littlespex@users.noreply.github.com>
  • Loading branch information
2 people authored and joeyparrish committed Dec 8, 2022
1 parent bb42e5f commit dff6683
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion lib/util/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ shaka.util.Platform = class {
return !!navigator.vendor && navigator.vendor.includes('Apple') &&
!shaka.util.Platform.isTizen() &&
!shaka.util.Platform.isEOS() &&
!shaka.util.Platform.isPS4();
!shaka.util.Platform.isVirginMedia() &&
!shaka.util.Platform.isPS4() &&
!shaka.util.Platform.isAmazonFireTV();
}

/**
Expand All @@ -246,6 +248,23 @@ shaka.util.Platform = class {
return shaka.util.Platform.userAgentContains_('PlayStation 4');
}

/**
* Check if the current platform is Virgin Media device.
*/
static isVirginMedia() {
return shaka.util.Platform.userAgentContains_('VirginMedia');
}

/**
* Check if the current platform is Amazon Fire TV.
* https://developer.amazon.com/docs/fire-tv/identify-amazon-fire-tv-devices.html
*
* @return {boolean}
*/
static isAmazonFireTV() {
return shaka.util.Platform.userAgentContains_('AFT');
}

/**
* Returns a major version number for Safari, or Safari-based iOS browsers.
*
Expand Down

0 comments on commit dff6683

Please sign in to comment.