Skip to content

[video_player] Do not require preventing display sleep during playback on iOS #98411

Description

@tinted-knight

Use case

On iOS AVPlayer has option to prevent display sleep during playback. This option is set to true by default according to Apple documentation.

In case you would like to continue playing video in background (maybe with some third-party plugin) there is a case when unlocked device will never sleep due to mentioned AVPlayer flag. And if you unlock device the screen will stay "on" while the video plays like on attached image (and draws additional battery). For now there is no way to switch this option with current video_player API.

Proposal

Suggestion is to set the preventsDisplaySleepDuringVideoPlayback flag of AVPlayer to false by default. The posibility to set this flag is available since iOS 12.
And you could still manually control state of the device screen if you would like to prevent sleeping, e.g. wakelock package

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterp: video_playerThe Video Player pluginpackageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions