screenOffTimeout
info
Added in Scrcpy 3.0
- Type:
number | undefined - Default value:
undefined
Controls how long the device screen should remain on after the scrcpy connection is established.
When not specified, the device will use its default timeout settings. This option allows specifying a custom timeout in milliseconds for how long the screen should stay on after connection. This option modifies the system's screen timeout setting temporarily during the scrcpy session.
Related options
stayAwake: Prevents the device from sleeping while screen casting is activepowerOffOnClose: Automatically powers off the Android device when the scrcpy connection is closed
Example
import { ScrcpyOptions3_0 } from "@yume-chan/scrcpy";
const options = new ScrcpyOptions3_0({
screenOffTimeout: 30000, // Keep screen on for 30 seconds after connection
});