I am working on an application that involves using AVPlayer to have a video in the background of an interface.
We've found that while video is playing, the app will never go to sleep. Is there a way to tell AVPlayer to allow the app to go to sleep regardless?
Set preventsDisplaySleepDuringVideo
to false
or NO
on the AVPlayer
instance.
https://developer.apple.com/documentation/avfoundation/avplayer/2990522-preventsdisplaysleepduringvideop
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With