closeAllMediaPresentations method
Closes all media the web view is presenting, including picture-in-picture video and fullscreen video.
Officially Supported Platforms/Implementations:
- iOS WKWebView 14.5+ (Official API - WKWebView.closeAllMediaPresentations)
- macOS WKWebView 11.3+ (Official API - WKWebView.closeAllMediaPresentations)
- Linux WPE WebKit (Official API - JavaScript Document.exitFullscreen()/exitPictureInPicture()):
- Uses JavaScript to exit fullscreen and picture-in-picture modes
Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.
Implementation
Future<void> closeAllMediaPresentations() =>
platform.closeAllMediaPresentations();