---
title: preventsDisplaySleepDuringVideoPlayback
framework: avfoundation
role: symbol
role_heading: Instance Property
path: avfoundation/avsamplebufferdisplaylayer/preventsdisplaysleepduringvideoplayback
---

# preventsDisplaySleepDuringVideoPlayback

A Boolean value that indicates whether the layer prevents the system from sleeping during video playback.

## Declaration

```swift
var preventsDisplaySleepDuringVideoPlayback: Bool { get set }
```

## Discussion

Discussion Setting this property to false doesn’t force the display to sleep; it only stops preventing display sleep. Other apps or frameworks within your app may still be preventing display sleep for various reasons. The default value is true in iOS, tvOS, and Mac Catalyst. The default value in macOS is false. note: If you enqueue sample buffers for playback at the user’s request, you should ensure that you set the value of this property to true. If your app isn’t displaying video as part of the user’s primary focus, set the value of this property to false.

## See Also

### Preventing backgrounding

- [preventsAutomaticBackgroundingDuringVideoPlayback](avfoundation/avsamplebufferdisplaylayer/preventsautomaticbackgroundingduringvideoplayback.md)
