From 0751aea48ec05db5f4c68b91eb41c026ae6aad32 Mon Sep 17 00:00:00 2001 From: MiaoMint <44718819+MiaoMint@users.noreply.github.com> Date: Wed, 13 Dec 2023 09:45:58 +0800 Subject: [PATCH 1/3] fix: video player title to long --- .../watch/video/video_player_content.dart | 90 +++++++++---------- 1 file changed, 42 insertions(+), 48 deletions(-) diff --git a/lib/views/pages/watch/video/video_player_content.dart b/lib/views/pages/watch/video/video_player_content.dart index 21e0e0ce..e8cd9dec 100644 --- a/lib/views/pages/watch/video/video_player_content.dart +++ b/lib/views/pages/watch/video/video_player_content.dart @@ -1,4 +1,5 @@ -import 'package:fluent_ui/fluent_ui.dart' as fluent; +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:media_kit_video/media_kit_video.dart'; @@ -21,36 +22,50 @@ class VideoPlayerConten extends StatefulWidget { class _VideoPlayerContenState extends State { late final _c = Get.find(tag: widget.tag); + final speeds = [0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0]; - String? selected; - final menuController = fluent.FlyoutController(); - Widget _buildDesktop(BuildContext context) { - final topButtonBar = Row( - children: [ - Expanded( - child: Obx( - () => Text( - "${_c.title} - ${_c.playList[_c.index.value].name}", - style: const TextStyle( - color: Colors.white, - fontSize: 20, + late final topButtonBar = Row( + children: [ + Expanded( + child: Obx( + () => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _c.title, + style: const TextStyle( + color: Colors.white, + fontSize: 18, + ), ), - ), + Text( + _c.playList[_c.index.value].name, + style: const TextStyle( + color: Colors.white, + fontSize: 1, + ), + ) + ], ), ), - MaterialDesktopCustomButton( - icon: const Icon( - Icons.keyboard_arrow_down, - color: Colors.white, - ), - onPressed: () async { - await WindowManager.instance.setFullScreen(false); - await _c.onExit(); - RouterUtils.pop(); - }, + ), + MaterialDesktopCustomButton( + icon: const Icon( + Icons.keyboard_arrow_down, + color: Colors.white, ), - ], - ); + onPressed: () async { + if (!Platform.isAndroid) { + await WindowManager.instance.setFullScreen(false); + } + await _c.onExit(); + RouterUtils.pop(); + }, + ), + ], + ); + + Widget _buildDesktop(BuildContext context) { return MaterialDesktopVideoControlsTheme( normal: MaterialDesktopVideoControlsThemeData( toggleFullscreenOnDoublePress: false, @@ -261,28 +276,7 @@ class _VideoPlayerContenState extends State { normal: MaterialVideoControlsThemeData( volumeGesture: true, brightnessGesture: true, - topButtonBar: [ - Obx( - () => Text( - "${_c.title} - ${_c.playList[_c.index.value].name}", - style: const TextStyle( - color: Colors.white, - fontSize: 18, - ), - ), - ), - const Spacer(), - MaterialCustomButton( - icon: const Icon( - Icons.keyboard_arrow_down, - color: Colors.white, - ), - onPressed: () async { - await _c.onExit(); - RouterUtils.pop(); - }, - ), - ], + topButtonBar: [Expanded(child: topButtonBar)], bottomButtonBar: [ Obx(() { if (_c.index.value > 0) { From bc8d9102e690f408e16ea796bef1c6fdf965d98c Mon Sep 17 00:00:00 2001 From: MiaoMint <44718819+MiaoMint@users.noreply.github.com> Date: Wed, 13 Dec 2023 09:52:40 +0800 Subject: [PATCH 2/3] fix --- lib/views/pages/watch/video/video_player_content.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/views/pages/watch/video/video_player_content.dart b/lib/views/pages/watch/video/video_player_content.dart index e8cd9dec..1fb264e7 100644 --- a/lib/views/pages/watch/video/video_player_content.dart +++ b/lib/views/pages/watch/video/video_player_content.dart @@ -42,7 +42,7 @@ class _VideoPlayerContenState extends State { _c.playList[_c.index.value].name, style: const TextStyle( color: Colors.white, - fontSize: 1, + fontSize: 14, ), ) ], From eaa07e42576215cbfe70ece6cc3e8300adbe685e Mon Sep 17 00:00:00 2001 From: MiaoMint <44718819+MiaoMint@users.noreply.github.com> Date: Wed, 13 Dec 2023 10:27:20 +0800 Subject: [PATCH 3/3] fix --- .../watch/video/video_player_content.dart | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/lib/views/pages/watch/video/video_player_content.dart b/lib/views/pages/watch/video/video_player_content.dart index 1fb264e7..0e8405ea 100644 --- a/lib/views/pages/watch/video/video_player_content.dart +++ b/lib/views/pages/watch/video/video_player_content.dart @@ -28,25 +28,28 @@ class _VideoPlayerContenState extends State { children: [ Expanded( child: Obx( - () => Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - _c.title, - style: const TextStyle( - color: Colors.white, - fontSize: 18, - ), + () => DefaultTextStyle( + style: const TextStyle( + overflow: TextOverflow.ellipsis, + color: Colors.white, ), - Text( - _c.playList[_c.index.value].name, - style: const TextStyle( - color: Colors.white, - fontSize: 14, - ), - ) - ], - ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _c.title, + style: const TextStyle( + fontSize: 18, + ), + ), + Text( + _c.playList[_c.index.value].name, + style: const TextStyle( + fontSize: 14, + ), + ) + ], + )), ), ), MaterialDesktopCustomButton(