CameraViews

CameraViews

The Camera UI View that displays all the camera feeds and provides the video elements to the WebRTC.

Constructor

new CameraViews(webrtc)

Source:
Parameters:
Name Type Description
webrtc WebRTC

The WebRTC Implementation to display

Members

(static) defaultOptions :Object

Source:

Assign the default options which are supported by the CameraViews UI

Type:
  • Object

webrtc :WebRTC

Source:

The WebRTCImplementation to display

Type:

Methods

(async) _render()

Source:

Render the CameraViews UI, set volumes and render accompanying objects. After the app is rendered, update PlayerList visibility and render video frames

activateListeners()

Source:

Listen to UI events, mute/hide, volume controls, popout, etc..

getData()

Source:

Prepare the default data which is required to render the CameraViews ui

getUserCameraView(userId) → {HTMLElement|null}

Source:

Obtain a reference to the div.camera-view which is used to portray a given Foundry User.

Parameters:
Name Type Description
userId string

The ID of the User entity

Returns:
Type
HTMLElement | null

getUserVideoElement(userId) → {HTMLVideoElement|null}

Source:

Obtain a reference to the video.user-camera which displays the video channel for a requested Foundry User. If the user is not broadcasting video this will return null.

Parameters:
Name Type Description
userId string

The ID of the User entity

Returns:
Type
HTMLVideoElement | null

render()

Source:

Extend the render logic to first check whether a render is necessary based on the context If a specific context was provided, make sure an update to the navigation is necessary before rendering

setUserIsSpeaking(userId, speaking)

Source:

Sets whether a user is currently speaking or not

Parameters:
Name Type Description
userId string

The ID of the user

speaking boolean

Whether the user is speaking