A Boolean value that determines whether HTML5 videos can play automatically or require the user to start playing them.
SDKs
- iOS 4.0–12.0Deprecated
- Mac Catalyst 13.0–13.0Deprecated
Framework
- UIKit
Declaration
var mediaPlaybackRequiresUserAction: Bool { get set }
Discussion
The default value on both iPad and iPhone is true
. To make media play automatically when loaded, set this property to false
and ensure the <audio>
or <video>
element you want to play has the autoplay
attribute set.