Add more control on inline video playback#33
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds more control over inline video playback by enabling platform-specific configurations for video handling in webviews. The changes update dependencies, enable inline media playback on iOS, and add better video control options.
- Updated webview dependencies to newer versions with additional platform-specific packages
- Added platform-specific webview controller creation with inline media playback support
- Implemented a new
stopLoading()method for better webview control
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pubspec.yaml | Updated package versions and added platform-specific webview dependencies |
| .fvmrc | Updated Flutter version to 3.32.8 |
| lib/src/adblocker_webview_controller.dart | Added stopLoading method interface |
| lib/src/adblocker_webview_controller_impl.dart | Implemented stopLoading method and added platform imports |
| lib/src/adblocker_webview.dart | Added platform-specific webview configuration with inline media playback support |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if (WebViewPlatform.instance is WebKitWebViewPlatform) { | ||
| final WebKitNavigationDelegate webKitDelegate = | ||
| navigationDelegate.platform as WebKitNavigationDelegate; | ||
| } else if (WebViewPlatform.instance is AndroidWebViewPlatform) { | ||
| final AndroidNavigationDelegate androidDelegate = | ||
| navigationDelegate.platform as AndroidNavigationDelegate; | ||
| } |
There was a problem hiding this comment.
The platform-specific navigation delegates are created but never used. Either utilize these delegates for platform-specific configuration or remove the unused variable assignments.
| if (WebViewPlatform.instance is WebKitWebViewPlatform) { | |
| final WebKitNavigationDelegate webKitDelegate = | |
| navigationDelegate.platform as WebKitNavigationDelegate; | |
| } else if (WebViewPlatform.instance is AndroidWebViewPlatform) { | |
| final AndroidNavigationDelegate androidDelegate = | |
| navigationDelegate.platform as AndroidNavigationDelegate; | |
| } | |
| // Platform-specific navigation delegates can be configured here if needed. |
| } | ||
|
|
||
| _webViewController = WebViewController.fromPlatformCreationParams(params); | ||
| // ··· |
There was a problem hiding this comment.
The comment '// ···' is unclear and doesn't provide meaningful information about the code that follows. Replace with a descriptive comment explaining the platform-specific configuration setup.
| // ··· | |
| // Perform Android-specific WebView configuration: enable debugging and require user gesture for media playback. |
No description provided.