The player API.

Hierarchy (view full)

Implements

Constructors

Properties

The adaptive bitrate configuration.

ads?: Ads

The ads API.

Remarks


- Only available with the feature 'ads'.

audio?: WebAudio

The web audio API.

Remarks


- Only available with the feature 'webaudio'.

audioTracks: MediaTrackList

List of audio tracks of the current source.

autoplay: boolean

Whether the player should immediately start playback after source change.

Remarks


- To autoplay with sound on certain platforms, ChromelessPlayer.prepareWithUserAction must be called at least once.
- To autoplay without sound, PlayerConfiguration.mutedAutoplay must be configured.

buffered: TimeRanges

Returns a TimeRanges object that represents the ranges of the media resource that the player has buffered.

canvas: Canvas

The canvas of the player.

cast?: Cast

The cast API.

Remarks


- Only available with the feature 'airplay' or 'chromecast'.

clip: Clip

The clip API.

currentProgramDateTime: null | Date

The current playback position of the media, as a timestamp.

Remarks


- The relation between ChromelessPlayer.currentProgramDateTime and ChromelessPlayer.currentTime is determined by the manifest.

currentTime: number

The current playback position of the media, in seconds.

duration: number

The duration of the media, in seconds.

Remarks


- On source change, duration becomes available after ChromelessPlayer.readyState is at least 1 (HAVE_METADATA).

element: HTMLElement

The HTML element containing the player.

ended: boolean

Whether playback of the media is ended.

Remarks


- Playback is ended when the current playback position is at the end of the media, and the player does not ChromelessPlayer.loop.

error: undefined | MediaError

The last error that occurred for the current source, if any.

Deprecated

use ChromelessPlayer.errorObject instead

errorObject: undefined | THEOplayerError

The last error that occurred for the current source, if any.

Remarks


- This will equal the ErrorEvent.errorObject property from the last ErrorEvent.

hesp?: HespApi

The HESP API.

Remarks


- Note: This API is in an experimental stage and may be subject to breaking changes.
- Only available with the feature 'hesp'.

imagine?: Imagine

The Imagine API.

Remarks


- Only available with the feature 'imagine'.

The latency manager for low latency live playback.

loop: boolean

Whether playback of the media is looped.

Remarks


- When playback is looped, upon reaching the end of the media, playback immediately continues at the start of the media.
- Looped media is never ChromelessPlayer.ended.

metrics: Metrics

The metrics API.

muted: boolean

Whether audio is muted.

Remarks


- This affects capabilities of ChromelessPlayer.autoplay.

network: Network

The network API.

paused: boolean

Whether the player is paused.

playbackRate: number

The playback rate of the media.

Example


- playbackRate = 0.70 will slow down the playback rate of the media by 30%.
- playbackRate = 1.25 will speed up the playback rate of the media by 25%.

Remarks


- Playback rate is represented by a number where 1 is default playback speed.
- Playback rate must be a positive number.
- It is recommended that you limit the range to between 0.5 and 4.

played: TimeRanges

Returns a TimeRanges object that represents the ranges of the media resource that the player has played.

poster: string

The poster of the current source.

Remarks


- An empty string ('') clears the current poster.
- The SourceConfiguration.poster has priority over this poster.

preload: PreloadType

The preload setting of the player.

presentation: Presentation

The presentation API.

readyState: number

The ready state of the player, represented by a value from the following list:
- 0 (HAVE_NOTHING): The player has no information about the duration of its source.
- 1 (HAVE_METADATA): The player has information about the duration of its source.
- 2 (HAVE_CURRENT_DATA): The player has its current frame in its buffer.
- 3 (HAVE_FUTURE_DATA): The player has enough data for immediate playback.
- 4 (HAVE_ENOUGH_DATA): The player has enough data for continuous playback.

Remarks


- See the HTML Media Specification

related?: RelatedContent

The related content API.

Remarks


- Only available with the feature 'relatedcontent'.

seekable: TimeRanges

Returns a TimeRanges object that represents the ranges of the media resource that are seekable by the player.

Remarks


- On source change, seekable becomes available after ChromelessPlayer.readyState is at least 1.

seeking: boolean

Whether the player is seeking.

source: undefined | SourceDescription

The current source which describes desired playback of a media resource.

Remarks


- Changing source might ChromelessPlayer.preload and ChromelessPlayer.autoplay.
- Changing source will ChromelessPlayer.stop the previous source.

src: undefined | string

The current URL of the media resource.

Remarks


- Prefer ChromelessPlayer.source instead.

textTrackStyle: TextTrackStyle

The text track style API.

textTracks: TextTracksList

List of text tracks of the current source.

theoLive?: TheoLiveApi
uid: number

Unique ID of the player.

verizonMedia?: VerizonMedia

The Verizon Media API.

Remarks


- Only available with the feature 'verizonmedia'.

videoHeight: number

The height of the active video rendition, in pixels.

videoTracks: MediaTrackList

List of video tracks of the current source.

videoWidth: number

The width of the active video rendition, in pixels.

visibility: Visibility

The visibility API.

volume: number

The volume of the audio.

Example


- volume = 0.7 will reduce the audio volume of the media by 30%.

Remarks


- Volume is represented by a floating point number between 0.0 and 1.0.

vr?: VR

The VR API.

Remarks


- Only available with the feature 'vr'.

Methods

  • Destroy the player.

    Returns void

    Remarks


    - Available since v2.26.
    - All resources associated with the current source are released.
    - All resources associated with the player are released.
    - The player can no longer be used.

  • Pause playback.

    Returns void

  • Start or resume playback.

    Returns void

  • Prepare the player to ChromelessPlayer.autoplay on platforms where autoplay is restricted without user action.

    Returns void

    Remarks


    - Any invocation must happen on user action.
    - Affected platforms include all mobile platforms and Safari 11+.

  • Set current source which describes desired playback of a media resource.

    Parameters

    Returns void

    Deprecated

    Superseded by ChromelessPlayer.source.

  • Stop playback.

    Returns void

    Remarks


    - All resources associated with the current source are released.
    - The player can be reused by setting a new ChromelessPlayer.source.