<theoplayer-default-ui> - A default UI for THEOplayer.

This default UI provides a great player experience out-of-the-box, that works well on all types of devices and for all types of streams. It provides all the common playback controls for playing, seeking, changing languages and qualities. It also supports advertisements and casting.

  1. Create a <theoplayer-default-ui> element.
  2. Set its configuration attribute or property to a valid player configuration.
  3. Set its source attribute or property to a valid stream source.
  4. Optionally, customize the player using CSS custom properties and/or extra controls.

The styling can be controlled using CSS custom properties (see <theoplayer-ui>). Additional controls can be added to the top-control-bar and bottom-control-bar slots. For more extensive customizations, we recommend defining your own custom UI using a <theoplayer-ui>.

configuration - The THEOplayer PlayerConfiguration, as a JSON string.

source - The THEOplayer SourceDescription, as a JSON string.

fluid - If set, the player automatically adjusts its height to fit the video's aspect ratio.

muted - If set, the player starts out as muted. Reflects ui.player.muted.

autoplay - If set, the player attempts to automatically start playing (if allowed).

device-type - The device type, either "desktop", "mobile" or "tv". Can be used in CSS to show/hide certain device-specific UI controls.

mobile - Whether the user is on a mobile device. Equivalent to device-type == "mobile".

tv - Whether the user is on a TV device. Equivalent to device-type == "tv".

stream-type - The stream type, either "vod", "live" or "dvr". Can be used to show/hide certain UI controls specific for livestreams, such as a <theoplayer-live-button>. If you know in advance that the source will be a livestream, you can set this attribute to avoid a screen flicker when the player switches between its VOD-specific and live-only controls.

user-idle-timeout - The timeout (in seconds) between when the user stops interacting with the UI, and when the user is considered to be "idle".

dvr-threshold - The minimum length (in seconds) of a livestream's sliding window for the stream to be DVR and its stream type to be set to "dvr".

title - A slot for the stream's title in the top control bar.

top-control-bar - A slot for extra UI controls in the top control bar.

bottom-control-bar - A slot for extra UI controls in the bottom control bar.

menu - A slot for extra menus (see <theoplayer-menu>).

Hierarchy (View Summary)

Constructors

Properties

_shadowRoot: ShadowRoot

Accessors

  • get autoplay(): boolean

    Whether the player should attempt to automatically start playback.

    Returns boolean

  • set autoplay(value: boolean): void

    Parameters

    • value: boolean

    Returns void

  • get dvrThreshold(): number

    The minimum length (in seconds) of a livestream's sliding window for the stream to be DVR and its stream type to be set to "dvr".

    Returns number

  • set dvrThreshold(value: number): void

    Parameters

    • value: number

    Returns void

  • get fluid(): boolean

    Whether to automatically adjusts the player's height to fit the video's aspect ratio.

    Returns boolean

  • set fluid(value: boolean): void

    Parameters

    • value: boolean

    Returns void

  • get muted(): boolean

    Whether the player's audio is muted.

    Returns boolean

  • set muted(value: boolean): void

    Parameters

    • value: boolean

    Returns void

  • get streamType(): StreamType

    The stream type, either "vod", "live" or "dvr".

    If you know in advance that the source will be a livestream, you can set this property to avoid a screen flicker when the player switches between its VOD-specific and live-only controls.

    Returns StreamType

  • set streamType(value: StreamType): void

    Parameters

    Returns void

  • get userIdleTimeout(): number

    The timeout (in seconds) between when the user stops interacting with the UI, and when the user is considered to be "idle".

    Returns number

  • set userIdleTimeout(value: number): void

    Parameters

    • value: number

    Returns void

Methods

  • Parameters

    • attrName: string
    • oldValue: any
    • newValue: any

    Returns void

Events

READY_EVENT: "theoplayerready" = READY_EVENT

Fired when the backing player is created, and the DefaultUI.player property is set.