Contents

setAllMediaPlaybackSuspended(_:completionHandler:)

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

Declaration

func setAllMediaPlaybackSuspended(_ suspended: Bool, completionHandler: (@MainActor @Sendable () -> Void)? = nil)
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

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