Members
Methods
anyMediaElement() → {HTMLMediaElement}
    For canPlayType queries, we just need any instance.
First, use a cached element from a previous query.
Second, search the page for one.
Third, create a temporary one.
Cached elements expire in one second so that they can be GC'd or removed.
- Source:
 
Returns:
- Type
 - HTMLMediaElement
 
chromeVersion() → {number}
    Returns a major version number for Chrome, or Chromium-based browsers.
For example:
  - Chrome 106.0.5249.61 returns 106.
  - Edge 106.0.1370.34 returns 106 (since this is based on Chromium).
  - Safari returns null (since this is independent of Chromium).
- Source:
 
Returns:
    A major version number or null if not Chromium-based.
- Type
 - number
 
detectMaxHardwareResolution() → {Promise.<shaka.extern.Resolution>}
    Detect the maximum resolution that the platform's hardware can handle.
- Source:
 
Returns:
- Type
 - Promise.<shaka.extern.Resolution>
 
getHdrLevel(preferHLG) → {string}
    Check the current HDR level supported by the screen.
    Parameters:
| Name | Type | Description | 
|---|---|---|
preferHLG | 
            
            boolean | 
- Source:
 
Returns:
- Type
 - string
 
isAndroid() → {boolean}
    Return true if the platform is a Android, regardless of the browser.
- Source:
 
Returns:
- Type
 - boolean
 
isAndroidCastDevice() → {boolean}
    Check if the current platform is a Google Chromecast with Android
(i.e. Chromecast with GoogleTV).
- Source:
 
Returns:
- Type
 - boolean
 
isApple() → {boolean}
    Check if the current platform is from Apple.
Returns true on all iOS browsers and on desktop Safari.
Returns false for non-Safari browsers on macOS, which are independent of
Apple.
- Source:
 
Returns:
- Type
 - boolean
 
isChrome() → {boolean}
    Check if the current platform is Google Chrome.
- Source:
 
Returns:
- Type
 - boolean
 
isChromecast() → {boolean}
    Check if the current platform is a Google Chromecast.
- Source:
 
Returns:
- Type
 - boolean
 
isEdge() → {boolean}
    Check if the current platform is MS Edge.
- Source:
 
Returns:
- Type
 - boolean
 
isFirefox() → {boolean}
    Check if the current platform is Firefox.
- Source:
 
Returns:
- Type
 - boolean
 
isFuchsia() → {boolean}
    Return true if the platform is a Fuchsia, regardless of the browser.
- Source:
 
Returns:
- Type
 - boolean
 
isFuchsiaCastDevice() → {boolean}
    Check if the current platform is a Google Chromecast with Fuchsia
(i.e. Google Nest Hub).
- Source:
 
Returns:
- Type
 - boolean
 
isHisense() → {boolean}
    Check if the current platform is Hisense.
- Source:
 
Returns:
- Type
 - boolean
 
isIE() → {boolean}
    Check if the current platform is MS IE.
- Source:
 
Returns:
- Type
 - boolean
 
isIOS() → {boolean}
    Guesses if the platform is an Apple mobile one (iOS, iPad, iPod).
- Source:
 
Returns:
- Type
 - boolean
 
isLegacyEdge() → {boolean}
    Check if the current platform is Legacy Edge.
- Source:
 
Returns:
- Type
 - boolean
 
isMac() → {boolean}
    Return true if the platform is a Mac, regardless of the browser.
- Source:
 
Returns:
- Type
 - boolean
 
isMobile() → {boolean}
    Guesses if the platform is a mobile one.
- Source:
 
Returns:
- Type
 - boolean
 
isOlderChromecast() → {boolean}
    Check if the current platform is a Google Chromecast without
Android or Fuchsia.
- Source:
 
Returns:
- Type
 - boolean
 
isOrange() → {boolean}
    Check if the current platform is Orange.
- Source:
 
Returns:
- Type
 - boolean
 
isPS4() → {boolean}
    Check if the current platform is Playstation 4.
- Source:
 
Returns:
- Type
 - boolean
 
isPS5() → {boolean}
    Check if the current platform is Playstation 5.
Returns true on Playstation 5 browsers.
Returns false for Playstation 5 browsers
- Source:
 
Returns:
- Type
 - boolean
 
isSeekingSlow() → {boolean}
    On some platforms, such as v1 Chromecasts, the act of seeking can take a
significant amount of time.
- Source:
 
Returns:
- Type
 - boolean
 
isSkyQ() → {boolean}
    Check if the current platform is SkyQ STB.
- Source:
 
Returns:
- Type
 - boolean
 
isSmartTV() → {boolean}
    Return true if the platform is controlled by a remote control.
- Source:
 
Returns:
- Type
 - boolean
 
isSonyTV() → {boolean}
    Check if the current platform is Sony TV.
- Source:
 
Returns:
- Type
 - boolean
 
isTizen() → {boolean}
    Check if the current platform is a Tizen TV.
- Source:
 
Returns:
- Type
 - boolean
 
isTizen2() → {boolean}
    Check if the current platform is a Tizen 2 TV.
- Source:
 
Returns:
- Type
 - boolean
 
isTizen3() → {boolean}
    Check if the current platform is a Tizen 3 TV.
- Source:
 
Returns:
- Type
 - boolean
 
isTizen4() → {boolean}
    Check if the current platform is a Tizen 4 TV.
- Source:
 
Returns:
- Type
 - boolean
 
isTizen5() → {boolean}
    Check if the current platform is a Tizen 5 TV.
- Source:
 
Returns:
- Type
 - boolean
 
isTizen5_0() → {boolean}
    Check if the current platform is a Tizen 5.0 TV.
- Source:
 
Returns:
- Type
 - boolean
 
isTizen6() → {boolean}
    Check if the current platform is a Tizen 6 TV.
- Source:
 
Returns:
- Type
 - boolean
 
isVisionOS() → {boolean}
    Return true if the platform is a VisionOS.
- Source:
 
Returns:
- Type
 - boolean
 
isVizio() → {boolean}
    Check if the current platform is Vizio TV.
- Source:
 
Returns:
- Type
 - boolean
 
isWebkitSTB() → {boolean}
    Checks is non-Apple STB based on Webkit.
- Source:
 
Returns:
- Type
 - boolean
 
isWebOS() → {boolean}
    Check if the current platform is a WebOS.
- Source:
 
Returns:
- Type
 - boolean
 
isWebOS3() → {boolean}
    Check if the current platform is a WebOS 3.
- Source:
 
Returns:
- Type
 - boolean
 
isWebOS4() → {boolean}
    Check if the current platform is a WebOS 4.
- Source:
 
Returns:
- Type
 - boolean
 
isWebOS5() → {boolean}
    Check if the current platform is a WebOS 5.
- Source:
 
Returns:
- Type
 - boolean
 
isWebOS6() → {boolean}
    Check if the current platform is a WebOS 6.
- Source:
 
Returns:
- Type
 - boolean
 
isWindows() → {boolean}
    Return true if the platform is a Windows, regardless of the browser.
- Source:
 
Returns:
- Type
 - boolean
 
isXboxOne() → {boolean}
    Check if the current platform is an Xbox One.
- Source:
 
Returns:
- Type
 - boolean
 
isZenterio() → {boolean}
    Check if the current platform is Deutsche Telecom Zenterio STB.
- Source:
 
Returns:
- Type
 - boolean
 
requiresEC3InitSegments() → {boolean}
    Returns true if the platform requires AC-3 signalling in init
segments to be replaced with EC-3 signalling.
For such platforms, MediaSourceEngine will attempt to work
around it by inserting fake EC-3 signalling into
initialization segments.
- Source:
 
Returns:
- Type
 - boolean
 
requiresEncryptionInfoInAllInitSegments(keySystemnullable, contentType) → {boolean}
    Returns true if the platform requires encryption information in all init
segments.  For such platforms, MediaSourceEngine will attempt to work
around a lack of such info by inserting fake encryption information into
initialization segments.
    Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
keySystem | 
            
            string | 
                
                
                    <nullable> | 
            
            
            |
contentType | 
            
            string | 
- Source:
 - See:
 
Returns:
- Type
 - boolean
 
requiresTfhdFix(contentType) → {boolean}
Parameters:
| Name | Type | Description | 
|---|---|---|
contentType | 
            
            string | 
- Source:
 
Returns:
- Type
 - boolean
 
safariVersion() → {number}
    Returns a major version number for Safari, or Webkit-based STBs,
or Safari-based iOS browsers.
For example:
  - Safari 13.0.4 on macOS returns 13.
  - Safari on iOS 13.3.1 returns 13.
  - Chrome on iOS 13.3.1 returns 13 (since this is based on Safari/WebKit).
  - Chrome on macOS returns null (since this is independent of Apple).
Returns null on Firefox on iOS, where this version information is not
available.
- Source:
 
Returns:
    A major version number or null if not iOS.
- Type
 - number
 
supportsMediaSource() → {boolean}
    Check if the current platform supports media source. We assume that if
the current platform supports media source, then we can use media source
as per its design.
- Source:
 
Returns:
- Type
 - boolean
 
supportsMediaType(mimeType) → {boolean}
    Returns true if the media type is supported natively by the platform.
    Parameters:
| Name | Type | Description | 
|---|---|---|
mimeType | 
            
            string | 
- Source:
 
Returns:
- Type
 - boolean
 
supportsSequenceMode() → {boolean}
    Returns true if the platform supports SourceBuffer "sequence mode".
- Source:
 
Returns:
- Type
 - boolean
 
supportsSmoothCodecSwitching() → {boolean}
    Returns if codec switching SMOOTH is known reliable device support.
Some devices are known not to support 
SourceBuffer.changeType
well. These devices should use the reload strategy. If a device
reports that it supports  but supports it unreliably
it should be disallowed in this method.
- Source:
 
Returns:
- Type
 - boolean
 
userAgentContains_(key) → {boolean}
    Check if the user agent contains a key. This is the best way we know of
right now to detect platforms. If there is a better way, please send a
PR.
    Parameters:
| Name | Type | Description | 
|---|---|---|
key | 
            
            string | 
- Source:
 
Returns:
- Type
 - boolean