Interface VideoTileController

[[VideoTileController]] allows one to manipulate how the underlying media streams are assigned to video elements. The caller is responsible for laying out video elements as desired and binding tile ids received from the observer in the [[videoTileUpdated]] callbacks.

interface VideoTileController {
    keepLastFrameWhenPaused?: boolean;
    addVideoTile(): VideoTile;
    bindVideoElement(tileId: number, videoElement: HTMLVideoElement): void;
    captureVideoTile(tileId: number): ImageData;
    getAllRemoteVideoTiles(): VideoTile[];
    getAllVideoTiles(): VideoTile[];
    getLocalVideoTile(): VideoTile;
    getVideoTile(tileId: number): VideoTile;
    getVideoTileArea(tile: VideoTile): number;
    getVideoTileForAttendeeId(attendeeId: string): VideoTile;
    hasStartedLocalVideoTile(): boolean;
    haveVideoTileForAttendeeId(attendeeId: string): boolean;
    haveVideoTilesWithStreams(): boolean;
    pauseVideoTile(tileId: number): void;
    registerVideoTileResolutionObserver(
        observer: VideoTileResolutionObserver,
    ): void;
    removeAllVideoTiles(): void;
    removeLocalVideoTile(): void;
    removeVideoTile(tileId: number): void;
    removeVideoTileResolutionObserver(
        observer: VideoTileResolutionObserver,
    ): void;
    removeVideoTilesByAttendeeId(attendeeId: string): number[];
    sendTileStateUpdate(tileState: VideoTileState): void;
    startLocalVideoTile(): number;
    stopLocalVideoTile(): void;
    unbindVideoElement(tileId: number, cleanUpVideoElement?: boolean): void;
    unpauseVideoTile(tileId: number): void;
}

Implemented by

Properties

keepLastFrameWhenPaused?: boolean

Methods

  • Binds the video element to the tile if it exists for the provided tileId. This should also be called any time the layout of the video element changes, for example, when changing its dimensions.

    Parameters

    • tileId: number
    • videoElement: HTMLVideoElement

    Returns void

  • Pauses the video tile if it exists and sends the updated video tile state to the meeting session's AudioVideoObserver’s [[videoTileDidUpdate]] callback. This API is intended to be called on the remote videos. If called on a local video tile, then the tile will no longer be updated, but the local video source will continue to be sent into the meeting.

    Parameters

    • tileId: number

    Returns void

  • Registers an observer that will be notified when the resolution of the video element changes, or when the video element is unbound.

    Parameters

    • observer: VideoTileResolutionObserver

      An instance of VideoElementResolutionObserver that will receive update notifications.

    Returns void

  • Disconnects the video source from the video element bounded with the video tile, removes the tile by the tileId and the AudioVideoObserver’s [[videoTileWasRemoved]] callback is called with the removed tile id.

    Parameters

    • tileId: number

    Returns void

  • Removes a previously registered observer, stopping it from receiving any further notifications.

    Parameters

    • observer: VideoTileResolutionObserver

      The observer to be removed from the notification queue.

    Returns void

  • Removes any tiles that have the given attendee id and returns the tile ids of the tiles removed

    Parameters

    • attendeeId: string

    Returns number[]

  • Starts sharing the local video tile by creating a new video tile if one does not already exist. Binds the created local video tile to the local video stream and then returns its tile id.

    Returns number

  • Unbinds the video element from the tile if it exists for the provided tileId. The video tile's bounded video element and that element's width and height are set to null.

    Parameters

    • tileId: number
    • OptionalcleanUpVideoElement: boolean

      By default, the bounded video element's srcObject is also set to null. Pass false for cleanUpVideoElement, if you do not intend to set the bounded video element's srcObject to null. This does not remove the provided tileId mapping from the tile map in the [[DefaultVideoTileController]]. To remove the mapping and destroy the tile for this tileId, you can use [[removeVideoTile]].

    Returns void

  • Unpauses the video tile if it exists and sends the updated video tile state to the meeting session's AudioVideoObserver’s [[videoTileDidUpdate]] callback. This API is intended to be called on the remote videos and has no effect on the local video. When called on a remote video tileId, the remote video source will start getting the updates if paused earlier.

    Parameters

    • tileId: number

    Returns void