checkInlineMediaPlaybackConfiguration method
allowsInlineMediaPlayback is a WebView creation-time setting the publisher must set themselves when building this controller. Warn loudly if it looks misconfigured so publishers can fix their setup, mirroring TBLFlutterWebViewControllerWrapper. Reads settings dynamically so this plugin doesn't need to depend on the flutter_inappwebview package types.
allowsInlineMediaPlayback is an iOS-only InAppWebViewSettings field - on Android it's always null, so this check would otherwise always warn.
Implementation
Future<void> checkInlineMediaPlaybackConfiguration() async {
if (!Platform.isIOS) {
return;
}
try {
final settings = await controller.getSettings();
if (settings == null) {
TBLLogger.log(
'TBLInAppWebViewControllerWrapper | checkInlineMediaPlaybackConfiguration | getSettings() returned null, skipping check');
return;
}
warnIfInlineMediaPlaybackNotConfigured(
settings.allowsInlineMediaPlayback == true);
} catch (e) {
TBLLogger.logException(
'TBLInAppWebViewControllerWrapper | checkInlineMediaPlaybackConfiguration | Failed to read settings: $e');
}
}