createPlayerView method
Widget
createPlayerView({
- Key? key,
- Map<
String, dynamic> ? args, - PlatformViewCreatedCallback? onViewCreated,
override
创建各平台对应的播放器
Implementation
@override
Widget createPlayerView({Key? key, Map<String, dynamic>? args, PlatformViewCreatedCallback? onViewCreated}) {
if (PlatformUtils.isAndroid()) {
log("createPlayerView.android");
return AndroidView(
key: key,
viewType: LivePlayer.playerViewType,
creationParams: args,
creationParamsCodec: const StandardMessageCodec(),
onPlatformViewCreated: onViewCreated,
);
}
if (PlatformUtils.isIos()) {
log("createPlayerView.ios");
return UiKitView(
key: key,
viewType: LivePlayer.playerViewType,
creationParams: args,
creationParamsCodec: const StandardMessageCodec(),
onPlatformViewCreated: onViewCreated,
);
}
return Container();
}