Skip to content

Commit

Permalink
fix(para)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchuancong committed Sep 4, 2023
1 parent 85b7b53 commit 48a5af3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class _MyAppState extends State<MyApp> with WindowListener {
}

return GetMaterialApp(
title: 'PureLive',
title: '纯粹直播',
themeMode:
SettingsService.themeModes[settings.themeModeName.value]!,
theme: lightTheme,
Expand Down
25 changes: 14 additions & 11 deletions lib/modules/live_play/widgets/video_player/video_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,7 @@ class VideoController with ChangeNotifier {
final bool autoPlay;
final videoFit = BoxFit.contain.obs;

// Video player status
// A [GlobalKey<VideoState>] is required to access the programmatic fullscreen interface.
late final GlobalKey<media_kit_video.VideoState> key =
GlobalKey<media_kit_video.VideoState>();
// Create a [Player] to control playback.
late final player = Player();
// Create a [VideoController] to handle video output from [Player].
late final controller = media_kit_video.VideoController(player, configuration: const media_kit_video.VideoControllerConfiguration(
enableHardwareAcceleration: true
));

ScreenBrightness brightnessController = ScreenBrightness();

final hasError = false.obs;
Expand All @@ -48,7 +39,19 @@ class VideoController with ChangeNotifier {
bool get supportPip => Platform.isAndroid;
bool get supportWindowFull => Platform.isWindows || Platform.isLinux;
bool get fullscreenUI => isFullscreen.value || isWindowFullscreen.value;

// Video player status
// A [GlobalKey<VideoState>] is required to access the programmatic fullscreen interface.
late final GlobalKey<media_kit_video.VideoState> key =
GlobalKey<media_kit_video.VideoState>();
// Create a [Player] to control playback.
late final player = Player();
// Create a [VideoController] to handle video output from [Player].
String? vo = Platform.isAndroid ? 'gpu' : 'libmpv';
String? hwdec = Platform.isAndroid ? 'mediacodec' : 'auto';
late final controller = media_kit_video.VideoController(player, configuration: media_kit_video.VideoControllerConfiguration(
enableHardwareAcceleration: false,
hwdec: hwdec
));
// Controller ui status
Timer? showControllerTimer;
final showController = true.obs;
Expand Down

0 comments on commit 48a5af3

Please sign in to comment.