This commit is contained in:
kodjomoustapha 2024-02-22 19:04:13 +01:00
parent 202aa97527
commit afc4c96bd0
4 changed files with 24 additions and 33 deletions

View file

@ -8,7 +8,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart' as riv;
import 'package:mangayomi/models/chapter.dart';
import 'package:mangayomi/models/video.dart' as vid;
import 'package:mangayomi/modules/anime/providers/anime_player_controller_provider.dart';
import 'package:mangayomi/modules/anime/providers/state_provider.dart';
import 'package:mangayomi/modules/anime/widgets/aniskip_countdown_btn.dart';
import 'package:mangayomi/modules/anime/widgets/desktop.dart';
import 'package:mangayomi/modules/anime/widgets/mobile.dart';
@ -1046,14 +1045,6 @@ class _AnimeStreamPageState extends riv.ConsumerState<AnimeStreamPage>
},
),
),
Positioned(
child: IgnorePointer(
child: CustomSubtitleView(
controller: _controller,
configuration:
SubtitleViewConfiguration(style: subtileTextStyle(ref)),
),
))
],
);
}
@ -1086,29 +1077,6 @@ Widget seekIndicatorTextWidget(Duration duration, Duration currentPosition) {
);
}
TextStyle subtileTextStyle(WidgetRef ref) {
final set = ref.watch(subtitleSettingsStateProvider);
final borderColor = Color.fromARGB(set.borderColorA!, set.borderColorR!,
set.borderColorG!, set.borderColorB!);
return TextStyle(
fontSize: set.fontSize!.toDouble(),
fontWeight: set.useBold! ? FontWeight.bold : null,
fontStyle: set.useItalic! ? FontStyle.italic : null,
color: Color.fromARGB(
set.textColorA!, set.textColorR!, set.textColorG!, set.textColorB!),
fontFamily: "",
shadows: [
Shadow(
offset: const Offset(-2, -2), color: borderColor, blurRadius: 1.5),
Shadow(
offset: const Offset(2, -2), color: borderColor, blurRadius: 1.5),
Shadow(offset: const Offset(2, 2), color: borderColor, blurRadius: 1.5),
Shadow(offset: const Offset(-2, 2), color: borderColor, blurRadius: 1.5)
],
backgroundColor: Color.fromARGB(set.backgroundColorA!,
set.backgroundColorR!, set.backgroundColorG!, set.backgroundColorB!));
}
class VideoPrefs {
String? title;
VideoTrack? videoTrack;

View file

@ -3,9 +3,11 @@ import 'dart:async';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:mangayomi/modules/anime/anime_player_view.dart';
import 'package:mangayomi/modules/anime/providers/anime_player_controller_provider.dart';
import 'package:mangayomi/modules/anime/widgets/custom_seekbar.dart';
import 'package:mangayomi/modules/anime/widgets/subtitle_view.dart';
import 'package:media_kit_video/media_kit_video.dart';
import 'package:media_kit_video/media_kit_video_controls/src/controls/extensions/duration.dart';
import 'package:window_manager/window_manager.dart';
@ -417,6 +419,16 @@ class _DesktopControllerWidgetState extends State<DesktopControllerWidget> {
),
),
),
Consumer(
builder: (context, ref, _) => Positioned(
child: IgnorePointer(
child: CustomSubtitleView(
controller: widget.videoController,
configuration: SubtitleViewConfiguration(
style: subtileTextStyle(ref)),
),
)),
)
],
),
),

View file

@ -6,6 +6,7 @@ import 'package:mangayomi/modules/anime/anime_player_view.dart';
import 'package:mangayomi/modules/anime/providers/anime_player_controller_provider.dart';
import 'package:mangayomi/modules/anime/widgets/custom_seekbar.dart';
import 'package:mangayomi/modules/anime/widgets/indicator_builder.dart';
import 'package:mangayomi/modules/anime/widgets/subtitle_view.dart';
import 'package:mangayomi/modules/manga/reader/providers/push_router.dart';
import 'package:mangayomi/modules/more/settings/player/providers/player_state_provider.dart';
import 'package:volume_controller/volume_controller.dart';
@ -643,6 +644,16 @@ class _MobileControllerWidgetState
],
),
),
Consumer(
builder: (context, ref, _) => Positioned(
child: IgnorePointer(
child: CustomSubtitleView(
controller: widget.videoController,
configuration:
SubtitleViewConfiguration(style: subtileTextStyle(ref)),
),
)),
)
],
),
);

View file

@ -97,7 +97,7 @@ Future<void> customDraggableTabBar(
await DraggableMenu.open(
context,
DraggableMenu(
curve: Curves.fastLinearToSlowEaseIn,
curve: Curves.linearToEaseOut,
controller: controller,
levels: widgetsHeight
.map((e) => e["height"])