Skip to content
0

katanakit-js / useRequestFullscreen

Function: useRequestFullscreen() ​

ts
function useRequestFullscreen(target?): Promise<void>;

Defined in: src/infrastructure/viewport/viewport.service.ts:285

Requests fullscreen on the given element (or the document root).

Parameters ​

ParameterTypeDescription
target?HTMLElementThe element to make fullscreen (defaults to document.documentElement).

Returns ​

Promise<void>

Throws ​

If fullscreen is not supported.

Example ​

ts
await useRequestFullscreen(videoElement);

Released under the MIT License.