Class: shaka.util.Platform

Constructor

new Platform()

Source:

Members

(private, static) cachedMediaElement_ :HTMLMediaElement

Type:
Source:

(private, static) cacheExpirationTimer_ :shaka.util.Timer

Type:
Source:

Methods

(static) anyMediaElement() → (non-null) {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

(static) 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

(static) isChrome() → {boolean}

Check if the current platform is Google Chrome.
Source:
Returns:
Type
boolean

(static) isChromecast() → {boolean}

Check if the current platform is a Google Chromecast.
Source:
Returns:
Type
boolean

(static) isEdge() → {boolean}

Check if the current platform is MS Edge.
Source:
Returns:
Type
boolean

(static) isIE() → {boolean}

Check if the current platform is MS IE.
Source:
Returns:
Type
boolean

(static) isMobile() → {boolean}

Guesses if the platform is a mobile one (iOS or Android).
Source:
Returns:
Type
boolean

(static) isTizen() → {boolean}

Check if the current platform is a Tizen TV.
Source:
Returns:
Type
boolean

(static) isTizen2() → {boolean}

Check if the current platform is a Tizen 2 TV.
Source:
Returns:
Type
boolean

(static) isTizen3() → {boolean}

Check if the current platform is a Tizen 3 TV.
Source:
Returns:
Type
boolean

(static) isVideoFutur() → {boolean}

Check if the current platform is a Video Futur.
Source:
Returns:
Type
boolean

(static) isWebOS() → {boolean}

Check if the current platform is a WebOS.
Source:
Returns:
Type
boolean

(static) safariVersion() → (nullable) {number}

Returns a major version number for Safari, 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

(static) 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

(static) 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

(private, static) 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