diff --git a/README.md b/README.md index c793d72ca..3a73f8fd5 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ for the up-to-date list of maintained branches of Shaka Player. |Tizen TV³ | - | - | - | - | - | - | - | - |**Y**| |WebOS⁶ | - | - | - | - | - | - | - | - |**Y**| |Hisense⁷ | - | - | - | - | - | - | - | - |**Y**| +|Vizio⁷ | - | - | - | - | - | - | - | - |**Y**| |Xbox One | - | - | - | - | - | - | - | - |**Y**| |Playstation 4⁷| - | - | - | - | - | - | - | - |**Y**| |Playstation 5⁷| - | - | - | - | - | - | - | - |**Y**| @@ -239,6 +240,7 @@ MSS features **not** supported: |Tizen TV |**Y** |**Y** | - | - |**Y** | |WebOS⁷ |untested⁷ |untested⁷| - | - |untested⁷ | |Hisense⁷ |untested⁷ |untested⁷| - | - |untested⁷ | +|Vizio⁷ |untested⁷ |untested⁷| - | - |untested⁷ | |Xbox One | - |**Y** | - | - | - | |Playstation 4⁷| - |untested⁷| - | - |untested⁷ | |Playstation 5⁷| - |untested⁷| - | - |untested⁷ | diff --git a/externs/shaka/player.js b/externs/shaka/player.js index 6cf4ea137..f964a1f1b 100644 --- a/externs/shaka/player.js +++ b/externs/shaka/player.js @@ -2061,20 +2061,20 @@ shaka.extern.MediaSourceConfiguration; * IMA on platforms that do not support multiple video elements. *
* Defaults to false except on Tizen, WebOS, Chromecast, - * Hisense, PlayStation 4, PlayStation5, Xbox whose default value is + * Hisense, PlayStation 4, PlayStation5, Xbox, Vizio whose default value is * true. * @property {boolean} skipPlayDetection * If this is true, we will load Client Side ads without waiting for a play * event. *
* Defaults to false except on Tizen, WebOS, Chromecast, - * Hisense, PlayStation 4, PlayStation5, Xbox whose default value is + * Hisense, PlayStation 4, PlayStation5, Xbox, Vizio whose default value is * true. * @property {boolean} supportsMultipleMediaElements * If this is true, the browser supports multiple media elements. *
* Defaults to true except on Tizen, WebOS, Chromecast, - * Hisense, PlayStation 4, PlayStation5, Xbox whose default value is + * Hisense, PlayStation 4, PlayStation5, Xbox, Vizio whose default value is * false. * @property {boolean} disableHLSInterstitial * If this is true, we ignore HLS interstitial events. diff --git a/lib/util/platform.js b/lib/util/platform.js index 8ab81a3c8..ce1a9cac5 100644 --- a/lib/util/platform.js +++ b/lib/util/platform.js @@ -222,7 +222,8 @@ shaka.util.Platform = class { * @return {boolean} */ static isChromecast() { - return shaka.util.Platform.userAgentContains_('CrKey'); + const Platform = shaka.util.Platform; + return Platform.userAgentContains_('CrKey') && !Platform.isVizio(); } /** @@ -337,6 +338,14 @@ shaka.util.Platform = class { shaka.util.Platform.userAgentContains_('VIDAA'); } + /** + * Check if the current platform is Vizio TV. + * @return {boolean} + */ + static isVizio() { + return shaka.util.Platform.userAgentContains_('VIZIO SmartCast'); + } + /** * Check if the current platform is Orange. * @return {boolean} @@ -539,7 +548,8 @@ shaka.util.Platform = class { if (Platform.isTizen() || Platform.isWebOS() || Platform.isXboxOne() || Platform.isPS4() || Platform.isPS5() || Platform.isChromecast() || - Platform.isHisense() || Platform.isWebkitSTB()) { + Platform.isHisense() || Platform.isVizio() || + Platform.isWebkitSTB()) { return true; } return false; diff --git a/project-words.txt b/project-words.txt index d1c71a4bf..401f4e7e3 100644 --- a/project-words.txt +++ b/project-words.txt @@ -194,6 +194,8 @@ Tizen Uplynk Verimatrix Vidaa +Vizio +VIZIO Vnova Widevine wiseplay diff --git a/test/util/platform_unit.js b/test/util/platform_unit.js index 6061b3aee..5fb681cd1 100644 --- a/test/util/platform_unit.js +++ b/test/util/platform_unit.js @@ -27,6 +27,9 @@ describe('Platform', () => { const webOs4 = 'Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.34 Safari/537.36 WebAppManager'; const webOs5 = 'Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36 WebAppManager'; const webOs6 = 'Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36 WebAppManager'; + + // cspell: disable-next-line + const vizio = 'Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 CrKey/1.0.999999 VIZIO SmartCast(Conjure/MTKF-5.1.516.1 FW/0.6.11.1-2 Model/V50C6-J09)'; /* eslint-enable max-len */ afterEach(() => { @@ -210,6 +213,12 @@ describe('Platform', () => { }); }); + it('checks is Vizio', () => { + setUserAgent(vizio); + expect(shaka.util.Platform.isVizio()).toBe(true); + expect(shaka.util.Platform.isChromecast()).toBe(false); + }); + describe('isMediaKeysPolyfilled', () => { let shakaMediaKeysPolyfill;