Skip to main content

Function: setScreenStateSource()

function setScreenStateSource(next: ScreenStateSource | undefined): void;

Defined in: packages/player/src/screen-state.ts:133

Replace the display-state signal.

Parameters

ParameterTypeDescription
nextScreenStateSource | undefinedThe source to use, or undefined to go back to the platform's (which is then re-resolved on the next read).

Returns

void

Remarks

Two legitimate uses:

  1. Tests. Install a fake and drive it; nothing needs a device.
  2. A surface that is not the device display. If your app is presenting to an external screen or a head unit, the phone's display being off does not mean nobody is looking — describe that surface here and the visualizer follows it.

Anything already subscribed keeps its subscription to the previous source until it re-subscribes, so install this before rendering the components that depend on it (in practice: at module scope, or in your root effect).