logo
THEOplayer
ChromelessPlayerfeaturesMultiViewPlayerPlayerPlayerConfigurationPlayerListplayersplayerSuiteVersionversiontheoplayer
ABR
Ads
Media and Text Tracks
Caching
Events
Player
Content protection
Analytics
Casting
Miscellaneous
Source
Verizon Media
HESP
Network
SSAI
Presentation
UI
VR

THEOplayer > MultiViewPlayer

MultiViewPlayer class

The MultiViewPlayer API.

Signature:

export declare class MultiViewPlayer implements EventDispatcher<MultiViewPlayerEventMap> 

Remarks


- Available since v4.3.0
- Only available with the feature 'multiviewplayer'.
- Only supported on modern browsers such as evergreen Chrome, Firefox and Safari. Not supported on Internet Explorer.

Properties

Property

Type

Description

autoplay

boolean

Whether the player should immediately start playback.

buffered

TimeRanges

Returns a TimeRanges object that represents the intersection of all buffered properties of the underlying players.

currentTime

number

The current playback position of the player currently at position zero.

duration

number

Returns the minimum of all duration properties of the underlying players.

ended

boolean

Whether any of the underlying players is ended.

errorObject

THEOplayerError | undefined

Returns the last error that occurred of the underlying players.

layout

MultiViewPlayerLayout

The currently selected layout.

mainAudioView

View | undefined

The View whose audio is in focus.

mainVideoView

View | undefined

The View whose video is in focus.

muted

boolean

Whether all the underlying players are muted.

paused

boolean

Whether any of the underlying players is muted.

playbackRate

number

Returns the playbackRate of the player at position zero.

played

TimeRanges

Returns the intersection of all played properties of the underlying players.

readyState

number

Returns the minimum of all readyState properties of the underlying players.

seekable

TimeRanges

Returns the intersection of all seekable properties of the underlying players.

seeking

boolean

Whether any of the underlying players is seeking.

views

ReadonlyArray<View>

Returns all Views in their respective order.

volume

number

Returns the volume of the player at position zero.

Methods

Method

Description

addEventListener​(type: TType | readonly TType[], listener: EventListener<MultiViewPlayerEventMap[TType]>): void

Add the given listener for the given event type(s).

destroy​(): void

Calls destroy() on all underlying players and removes all views.

exitFullscreen​(): void

Disables fullscreen mode.

load​(label: string, source: SourceDescription, description: string, offset: number): View

Creates a new view.

pause​(): void

Calls pause() on all underlying players.

play​(): void

Calls play() on all underlying players and starts in-sync playback.

prepareWithUserAction​(): void

Calls prepareWithUserAction() on all underlying players.

removeEventListener​(type: TType | readonly TType[], listener: EventListener<MultiViewPlayerEventMap[TType]>): void

Remove the given listener for the given event type(s).

requestFullscreen​(options: FullscreenOptions): void

Enables fullscreen mode on the element of the MultiViewPlayer.

stop​(): void

Stops playback and removes all views.

Property Details

autoplay

Whether the player should immediately start playback.

Signature:

autoplay: boolean;

Remarks


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

buffered

Returns a TimeRanges object that represents the intersection of all buffered properties of the underlying players.

Signature:

readonly buffered: TimeRanges;

currentTime

The current playback position of the player currently at position zero.

Signature:

currentTime: number;

duration

Returns the minimum of all duration properties of the underlying players.

Signature:

readonly duration: number;

ended

Whether any of the underlying players is ended.

Signature:

readonly ended: boolean;

errorObject

Returns the last error that occurred of the underlying players.

Signature:

readonly errorObject: THEOplayerError | undefined;

layout

The currently selected layout.

Signature:

layout: MultiViewPlayerLayout;

mainAudioView

The View whose audio is in focus.

Signature:

readonly mainAudioView: View | undefined;

Remarks


Only one view can have audio focus at a time.

mainVideoView

The View whose video is in focus.

Signature:

readonly mainVideoView: View | undefined;

Remarks


This is the same as the View at position zero.

muted

Whether all the underlying players are muted.

Signature:

muted: boolean;

paused

Whether any of the underlying players is muted.

Signature:

readonly paused: boolean;

playbackRate

Returns the playbackRate of the player at position zero.

Signature:

playbackRate: number;

played

Returns the intersection of all played properties of the underlying players.

Signature:

readonly played: TimeRanges;

readyState

Returns the minimum of all readyState properties of the underlying players.

Signature:

readonly readyState: number;

seekable

Returns the intersection of all seekable properties of the underlying players.

Signature:

readonly seekable: TimeRanges;

seeking

Whether any of the underlying players is seeking.

Signature:

readonly seeking: boolean;

views

Returns all Views in their respective order.

Signature:

readonly views: ReadonlyArray<View>;

volume

Returns the volume of the player at position zero.

Signature:

volume: number;

Method Details

addEventListener

Add the given listener for the given event type(s).

Signature:

addEventListener<TType extends StringKeyOf<MultiViewPlayerEventMap>>(type: TType | readonly TType[], listener: EventListener<MultiViewPlayerEventMap[TType]>): void;

Parameters

Parameter

Type

Description

type

TType | readonly TType[]

The type of the event.

listener

EventListener<MultiViewPlayerEventMap[TType]>

The callback which is executed when the event occurs.

destroy

Calls destroy() on all underlying players and removes all views.

Signature:

destroy(): void;

exitFullscreen

Disables fullscreen mode.

Signature:

exitFullscreen(): void;

load

Creates a new view.

Signature:

load(label: string, source: SourceDescription, description?: string, offset?: number): View;

Parameters

Parameter

Type

Description

label

string

The name belonging to a view which is used in the multiview menu.

source

SourceDescription

The SourceDescription set on the view.

description

string

A short description of the view which will be displayed on top.

offset

number

The offset in milliseconds used for improving synchronization between views.

Remarks


- If the given label clashes with an existing label, the existing view will be returned.
- A player which is created is with position set to the length of MultiViewPlayer.views.

pause

Calls pause() on all underlying players.

Signature:

pause(): void;

play

Calls play() on all underlying players and starts in-sync playback.

Signature:

play(): void;

prepareWithUserAction

Calls prepareWithUserAction() on all underlying players.

Signature:

prepareWithUserAction(): void;

removeEventListener

Remove the given listener for the given event type(s).

Signature:

removeEventListener<TType extends StringKeyOf<MultiViewPlayerEventMap>>(type: TType | readonly TType[], listener: EventListener<MultiViewPlayerEventMap[TType]>): void;

Parameters

Parameter

Type

Description

type

TType | readonly TType[]

The type of the event.

listener

EventListener<MultiViewPlayerEventMap[TType]>

The callback which will be removed.

requestFullscreen

Enables fullscreen mode on the element of the MultiViewPlayer.

Signature:

requestFullscreen(options?: FullscreenOptions): void;

Parameters

Parameter

Type

Description

options

FullscreenOptions

stop

Stops playback and removes all views.

Signature:

stop(): void;
github
Make sure to follow us on GitHub!
THEO-logo-white
twitter
facebook
linkedin
Copyright © 2022. All Rights Reserved.
Leuven
New York
Singapore
Barcelona