Screen helpers · function

requestFullscreenOnGesture

Ask for fullscreen on the next gesture of any kind, once, on a handheld.

Explained in Recording and clips.

function requestFullscreenOnGesture(element: HTMLElement): () => void
import { requestFullscreenOnGesture } from '@driftengine/core';

Parameters

ParameterTypeDescription
elementHTMLElement

In depth

Returns the way to stop listening. The listeners are passive and in the capture phase, matching the audio unlock that shares this moment: a page whose first gesture has to both start the audio graph and claim the screen should do both from that one gesture, not ask for a second one.

Failure is silence by design. requestFullscreen rejects when the browser is not satisfied that a gesture is in progress, when an ancestor iframe has no allowfullscreen, and on platforms that expose the method and refuse it anyway. None of those is worth a message to somebody who did not ask for fullscreen in the first place and whose game is running either way.