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 an Apple device (iOS, desktop Safari, etc)
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) isTizen3() → {boolean}

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

(static) isWebOS() → {boolean}

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

(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