setAllMediaPlaybackSuspended method
- required bool suspended,
Changes whether the webpage is suspending playback of all media in the page.
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.
suspended represents a bool value that indicates whether the webpage should suspend media playback.
Officially Supported Platforms/Implementations:
- iOS WKWebView 15.0+ (Official API - WKWebView.setAllMediaPlaybackSuspended)
- macOS WKWebView 12.0+ (Official API - WKWebView.setAllMediaPlaybackSuspended)
- Linux WPE WebKit (Official API - JavaScript HTMLMediaElement.pause()/play()):
- Uses JavaScript to suspend/resume all media elements
Parameters - Officially Supported Platforms/Implementations:
suspended: all platforms
Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.
Implementation
Future<void> setAllMediaPlaybackSuspended({required bool suspended}) =>
platform.setAllMediaPlaybackSuspended(suspended: suspended);