<!--
{
  "availability" : [
    "iOS: 4.0.0 - 12.0.0",
    "iPadOS: 4.0.0 - 12.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIWebView/mediaPlaybackRequiresUserAction",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIWebView(py)mediaPlaybackRequiresUserAction"
  },
  "title" : "mediaPlaybackRequiresUserAction"
}
-->

# mediaPlaybackRequiresUserAction

A Boolean value that determines whether HTML5 videos can play automatically or require the user to start playing them.

```
var mediaPlaybackRequiresUserAction: Bool { get set }
```

## Discussion

The default value on both iPad and iPhone is <doc://com.apple.documentation/documentation/Swift/true>. To make media play automatically when loaded, set this property to <doc://com.apple.documentation/documentation/Swift/false> and ensure the `<audio>` or `<video>` element you want to play has the `autoplay` attribute set.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)