Skip to content

Commit

Permalink
fix: Do not recognize MultiChoice & Ziggo as Apple (#7996)
Browse files Browse the repository at this point in the history
  • Loading branch information
tykus160 authored and avelad committed Feb 5, 2025
1 parent c352d78 commit 81c9255
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
25 changes: 23 additions & 2 deletions lib/util/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,13 +307,15 @@ shaka.util.Platform = class {
!shaka.util.Platform.isTizen() &&
!shaka.util.Platform.isEOS() &&
!shaka.util.Platform.isAPL() &&
!shaka.util.Platform.isAPP() &&
!shaka.util.Platform.isVirginMedia() &&
!shaka.util.Platform.isOrange() &&
!shaka.util.Platform.isPS4() &&
!shaka.util.Platform.isAmazonFireTV() &&
!shaka.util.Platform.isComcastX1() &&
!shaka.util.Platform.isZenterio() &&
!shaka.util.Platform.isSkyQ();
!shaka.util.Platform.isSkyQ() &&
!shaka.util.Platform.isMultiChoice();
}

/**
Expand Down Expand Up @@ -396,6 +398,16 @@ shaka.util.Platform = class {
return shaka.util.Platform.userAgentContains_('DT_STB_BCM');
}

/**
* Check if the current platform is a MultiChoice STB.
* @return {boolean}
*/
static isMultiChoice() {
// cspell: ignore MDMP
return shaka.util.Platform.userAgentContains_('MDMP1001S') ||
shaka.util.Platform.userAgentContains_('PS5525IMC');
}

/**
* Returns a major version number for Safari, or Safari-based iOS browsers.
*
Expand Down Expand Up @@ -461,6 +473,14 @@ shaka.util.Platform = class {
return shaka.util.Platform.userAgentContains_('PC=APL');
}

/**
* Check if the current platform is an APPSTB set-top box.
* @return {boolean}
*/
static isAPP() {
return shaka.util.Platform.userAgentContains_('PC=APPSTB');
}

/**
* Guesses if the platform is a mobile one (iOS or Android).
*
Expand Down Expand Up @@ -568,7 +588,8 @@ shaka.util.Platform = class {
Platform.isEOS() || Platform.isAPL() ||
Platform.isVirginMedia() || Platform.isOrange() ||
Platform.isComcastX1() || Platform.isChromecast() ||
Platform.isHisense() || Platform.isZenterio()) {
Platform.isHisense() || Platform.isZenterio() ||
Platform.isAPP() || Platform.isMultiChoice()) {
return true;
}
return false;
Expand Down
1 change: 1 addition & 0 deletions project-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ linksource
longname

# 3rd party
APPSTB
Bitcodin
Brightcove
Broadpeak
Expand Down

0 comments on commit 81c9255

Please sign in to comment.