---
title: "requestMediaPlaybackState(completionHandler:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkwebview/requestmediaplaybackstate(completionhandler:)"
---

# requestMediaPlaybackState(completionHandler:)

Requests the playback status of media in the web view.

## Declaration

```swift
func requestMediaPlaybackState(completionHandler: @escaping @MainActor @Sendable (WKMediaPlaybackState) -> Void)
```

```swift
func requestMediaPlaybackState() async -> WKMediaPlaybackState
```

## Parameters

- `completionHandler`: A closure the system executes after the web view determines the current state of media playback.

## See Also

### Interacting with media

- [pauseAllMediaPlayback(completionHandler:)](webkit/wkwebview/pauseallmediaplayback(completionhandler:).md)
- [setAllMediaPlaybackSuspended(_:completionHandler:)](webkit/wkwebview/setallmediaplaybacksuspended(_:completionhandler:).md)
- [closeAllMediaPresentations(completionHandler:)](webkit/wkwebview/closeallmediapresentations(completionhandler:).md)
- [WKMediaPlaybackState](webkit/wkmediaplaybackstate.md)
