import 'package:flutter/foundation.dart'; import 'package:video_player/video_player.dart'; import 'package:wow_english/utils/sp_util.dart'; /// User-selectable Android video output path for device compatibility testing. class VideoRenderingPreference { static const _usePlatformViewKey = 'video_player_use_platform_view'; static bool get usesPlatformView => SpUtil.getInstance().get(_usePlatformViewKey) ?? false; static VideoViewType get viewType => defaultTargetPlatform == TargetPlatform.android && usesPlatformView ? VideoViewType.platformView : VideoViewType.textureView; static Future setUsesPlatformView(bool value) => SpUtil.getInstance().setData(_usePlatformViewKey, value); }