---
title: "setAllMediaPlaybackSuspended(_:completionHandler:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkwebview/setallmediaplaybacksuspended(_:completionhandler:)"
---

# setAllMediaPlaybackSuspended(_:completionHandler:)

Changes whether the webpage is suspending playback of all media in the page.

## Declaration

```swift
func setAllMediaPlaybackSuspended(_ suspended: Bool, completionHandler: (@MainActor @Sendable () -> Void)? = nil)
```

```swift
func setAllMediaPlaybackSuspended(_ suspended: Bool) async
```

## Parameters

- `suspended`: A Boolean value that indicates whether the webpage should suspend media playback.
- `completionHandler`: A closure the system executes after it completes changing the media playback suspension status.

## Discussion

Discussion Pass true to pause all media the web view is playing. Neither the user nor the webpage can resume playback until you call this method again with false.

## See Also

### Interacting with media

- [pauseAllMediaPlayback(completionHandler:)](webkit/wkwebview/pauseallmediaplayback(completionhandler:).md)
- [requestMediaPlaybackState(completionHandler:)](webkit/wkwebview/requestmediaplaybackstate(completionhandler:).md)
- [closeAllMediaPresentations(completionHandler:)](webkit/wkwebview/closeallmediapresentations(completionhandler:).md)
- [WKMediaPlaybackState](webkit/wkmediaplaybackstate.md)
