Skip to content

Commit

Permalink
Merge pull request #144 from miru-project/fix/video-player-title-to-long
Browse files Browse the repository at this point in the history
fix: video player title too long
  • Loading branch information
appdevelpo authored Dec 13, 2023
2 parents 798e8d1 + eaa07e4 commit dd1fca5
Showing 1 changed file with 44 additions and 47 deletions.
91 changes: 44 additions & 47 deletions lib/views/pages/watch/video/video_player_content.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -21,36 +22,53 @@ class VideoPlayerConten extends StatefulWidget {

class _VideoPlayerContenState extends State<VideoPlayerConten> {
late final _c = Get.find<VideoPlayerController>(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}",
late final topButtonBar = Row(
children: [
Expanded(
child: Obx(
() => DefaultTextStyle(
style: const TextStyle(
overflow: TextOverflow.ellipsis,
color: Colors.white,
fontSize: 20,
),
),
),
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(
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,
Expand Down Expand Up @@ -261,28 +279,7 @@ class _VideoPlayerContenState extends State<VideoPlayerConten> {
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) {
Expand Down

0 comments on commit dd1fca5

Please sign in to comment.