THEOplayer > MultiViewPlayer
The MultiViewPlayer API.
Signature:
export declare class MultiViewPlayer implements EventDispatcher<MultiViewPlayerEventMap>
- 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.
Property |
Type |
Description |
---|---|---|
|
Whether the player should immediately start playback. |
|
Returns a TimeRanges object that represents the intersection of all buffered properties of the underlying players. |
||
|
The current playback position of the player currently at position zero. |
|
|
Returns the minimum of all duration properties of the underlying players. |
|
|
Whether any of the underlying players is ended. |
|
THEOplayerError |
Returns the last error that occurred of the underlying players. |
|
The currently selected layout. |
||
View |
The View whose audio is in focus. |
|
View |
The View whose video is in focus. |
|
|
Whether all the underlying players are muted. |
|
|
Whether any of the underlying players is muted. |
|
|
Returns the playbackRate of the player at position zero. |
|
Returns the intersection of all played properties of the underlying players. |
||
|
Returns the minimum of all readyState properties of the underlying players. |
|
Returns the intersection of all seekable properties of the underlying players. |
||
|
Whether any of the underlying players is seeking. |
|
|
Returns all Views in their respective order. |
|
|
Returns the volume of the player at position zero. |
Method |
Description |
---|---|
addEventListener(type: |
Add the given listener for the given event type(s). |
destroy(): |
Calls destroy() on all underlying players and removes all views. |
exitFullscreen(): |
Disables fullscreen mode. |
load(label: |
Creates a new view. |
pause(): |
Calls pause() on all underlying players. |
play(): |
Calls play() on all underlying players and starts in-sync playback. |
prepareWithUserAction(): |
Calls prepareWithUserAction() on all underlying players. |
removeEventListener(type: |
Remove the given listener for the given event type(s). |
requestFullscreen(options: |
Enables fullscreen mode on the element of the MultiViewPlayer. |
stop(): |
Stops playback and removes all views. |
Whether the player should immediately start playback.
Signature:
autoplay: boolean;
- To autoplay with sound on certain platforms, MultiViewPlayer.prepareWithUserAction() must be called at least once.
- To autoplay without sound, PlayerConfiguration.mutedAutoplay must be configured.
Returns a TimeRanges object that represents the intersection of all buffered properties of the underlying players.
Signature:
readonly buffered: TimeRanges;
The current playback position of the player currently at position zero.
Signature:
currentTime: number;
Returns the minimum of all duration properties of the underlying players.
Signature:
readonly duration: number;
Whether any of the underlying players is ended.
Signature:
readonly ended: boolean;
Returns the last error that occurred of the underlying players.
Signature:
readonly errorObject: THEOplayerError | undefined;
The currently selected layout.
Signature:
layout: MultiViewPlayerLayout;
The View whose audio is in focus.
Signature:
readonly mainAudioView: View | undefined;
Only one view can have audio focus at a time.
The View whose video is in focus.
Signature:
readonly mainVideoView: View | undefined;
This is the same as the View at position zero.
Whether all the underlying players are muted.
Signature:
muted: boolean;
Whether any of the underlying players is muted.
Signature:
readonly paused: boolean;
Returns the playbackRate of the player at position zero.
Signature:
playbackRate: number;
Returns the intersection of all played properties of the underlying players.
Signature:
readonly played: TimeRanges;
Returns the minimum of all readyState properties of the underlying players.
Signature:
readonly readyState: number;
Returns the intersection of all seekable properties of the underlying players.
Signature:
readonly seekable: TimeRanges;
Whether any of the underlying players is seeking.
Signature:
readonly seeking: boolean;
Returns all Views in their respective order.
Signature:
readonly views: ReadonlyArray<View>;
Returns the volume of the player at position zero.
Signature:
volume: number;
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;
Parameter |
Type |
Description |
---|---|---|
type |
|
The type of the event. |
listener |
EventListener |
The callback which is executed when the event occurs. |
Calls destroy() on all underlying players and removes all views.
Signature:
destroy(): void;
Disables fullscreen mode.
Signature:
exitFullscreen(): void;
Creates a new view.
Signature:
load(label: string, source: SourceDescription, description?: string, offset?: number): View;
Parameter |
Type |
Description |
---|---|---|
label |
|
The name belonging to a view which is used in the multiview menu. |
source |
The SourceDescription set on the view. |
|
description |
|
A short description of the view which will be displayed on top. |
offset |
|
The offset in milliseconds used for improving synchronization between views. |
- 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.
Calls pause() on all underlying players.
Signature:
pause(): void;
Calls play() on all underlying players and starts in-sync playback.
Signature:
play(): void;
Calls prepareWithUserAction() on all underlying players.
Signature:
prepareWithUserAction(): void;
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;
Parameter |
Type |
Description |
---|---|---|
type |
|
The type of the event. |
listener |
EventListener |
The callback which will be removed. |
Enables fullscreen mode on the element of the MultiViewPlayer.
Signature:
requestFullscreen(options?: FullscreenOptions): void;
Parameter |
Type |
Description |
---|---|---|
options |
|
Stops playback and removes all views.
Signature:
stop(): void;