import 'package:flutter/foundation.dart' show defaultTargetPlatform, kIsWeb, TargetPlatform; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; /// Live DJI primary video feed, rendered by the native `DjiVideoView` /// [PlatformView] (Android only). Used as the full-bleed background of the /// Flight Control HUD. /// /// On non-Android targets (or when the SDK has no active feed) the native side /// simply renders black, so callers gate this behind a real connection and fall /// back to a placeholder otherwise. class DjiVideoView extends StatelessWidget { const DjiVideoView({super.key}); /// Must match `DjiVideoView.VIEW_TYPE` on the native side. static const String _viewType = 'dji_msdk/video'; @override Widget build(BuildContext context) { if (kIsWeb || defaultTargetPlatform != TargetPlatform.android) { return const SizedBox.shrink(); } return const AndroidView( viewType: _viewType, creationParamsCodec: StandardMessageCodec(), ); } }