openVideoPlayer method Null safety
- {required String url,
- VideoPlayerConfiguration? config}
Opens video url
with the config
.
Implementation
Future<void> openVideoPlayer({
required String url,
VideoPlayerConfiguration? config,
}) async {
if (!FWGlobalState.getInstance().sdkInitCalled) {
await FWGlobalState.getInstance().sdkInitCalledFuture;
}
final nativeMethodName = FireworkSDKNativeMethodName.openVideoPlayer.name;
Map<String, dynamic> arg = {
"url": url,
};
if (config != null) {
arg["config"] = VideoPlayerConfigurationUtil.toJson(config);
}
FWMethodChannelUtil.getFirewokSDKChannel()
.invokeMethod(nativeMethodName, arg);
}