Skip to content

[video_player] Allow screen auto-lock during video playback on iOS #183520

Description

@shrabanti722

Use case

The video_player plugin keeps the screen awake during playback. Some apps (e.g. login screens with background videos, ambient content) want the screen to be able to auto-lock while video plays. There is currently no way to allow this on iOS.

Proposal

Add an option to VideoPlayerOptions (e.g. allowScreenAutoLock) that lets apps opt in to allowing screen auto-lock during playback. When enabled, the screen can auto-lock as usual while video continues playing.

Using wakelock_plus – does not reliably control screen auto-lock during video playback on iOS.
Using other video packages (e.g. Chewie, Better Player) – they have similar limitations; see fluttercommunity/chewie#808.

Additional context

On iOS, AVPlayer has preventsDisplaySleepDuringVideoPlayback, which is enabled by default and keeps the screen awake. Setting it to false when the app opts in would allow the screen to auto-lock during playback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: proposalA detailed proposal for a change to Flutterfyi-ecosystemFor the attention of Ecosystem teamp: video_playerThe Video Player pluginpackageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallyteam-iosOwned by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions