Skip to content

Function: useVisibleTile() ​

ts
function useVisibleTile(track): (element) => void;

A ref for the element that shows a remote video: const ref = useVisibleTile(track), then <video ref={ref} />. It attaches the track to the element — use it instead of track.ref, not as well — and reports the element's size and whether it is on screen, so an off-screen tile is paused and a small one is sent a small video. The ref is stable across renders. One track may be shown by several tiles; it is sent for the largest one visible.

Parameters ​

ParameterType
trackTrack | null

Returns ​

(element) => void

Talkline documentation