Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a039f09ec3 | ||
|
|
c7f507836b | ||
|
|
1395cfd414 |
@@ -10,7 +10,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/RarDog/Lunaris/releases"><img src="https://img.shields.io/badge/Version-3.1.6-8A2BE2?style=for-the-badge&logo=semver&logoColor=white" alt="Version 3.1.6" /></a>
|
<a href="https://github.com/RarDog/Lunaris/releases"><img src="https://img.shields.io/badge/Version-3.1.9-8A2BE2?style=for-the-badge&logo=semver&logoColor=white" alt="Version 3.1.9" /></a>
|
||||||
<img src="https://img.shields.io/badge/Flutter-3.47+-02569B?style=for-the-badge&logo=flutter&logoColor=white" alt="Flutter" />
|
<img src="https://img.shields.io/badge/Flutter-3.47+-02569B?style=for-the-badge&logo=flutter&logoColor=white" alt="Flutter" />
|
||||||
<img src="https://img.shields.io/badge/Platform-Android%20%7C%20Linux%20%7C%20Windows-00C853?style=for-the-badge" alt="Platforms" />
|
<img src="https://img.shields.io/badge/Platform-Android%20%7C%20Linux%20%7C%20Windows-00C853?style=for-the-badge" alt="Platforms" />
|
||||||
<a href="https://github.com/RarDog/Lunaris/wiki"><img src="https://img.shields.io/badge/Wiki-Documentation-FF6F00?style=for-the-badge&logo=gitbook&logoColor=white" alt="Wiki" /></a>
|
<a href="https://github.com/RarDog/Lunaris/wiki"><img src="https://img.shields.io/badge/Wiki-Documentation-FF6F00?style=for-the-badge&logo=gitbook&logoColor=white" alt="Wiki" /></a>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
const appDisplayVersion = '3.1.6';
|
const appDisplayVersion = '3.1.9';
|
||||||
const appBuildNumber = 67;
|
const appBuildNumber = 70;
|
||||||
const appReleaseChannel = 'Stable';
|
const appReleaseChannel = 'Stable';
|
||||||
|
|||||||
@@ -1,4 +1,33 @@
|
|||||||
const lunarisChangelog = [
|
const lunarisChangelog = [
|
||||||
|
LunarisChange(
|
||||||
|
version: '3.1.9',
|
||||||
|
title: 'Полноэкранный плеер 2.0: мгновенный переход без задержек, жесты яркости и скраббинг с превью',
|
||||||
|
bullets: [
|
||||||
|
'Мгновенный переход в полноэкранный режим: убраны промежуточные задержки и наложения текстур, вход и выход происходят без малейших задержек.',
|
||||||
|
'Двухзонное жестовое управление: левая сторона экрана регулирует яркость подсветки с индикатором солнца, правая сторона — громкость звука.',
|
||||||
|
'Плавный скраббинг с плавающим таймингом: перемещение по таймлайну видео теперь отображает интерактивную плашку точного времени, а контролы не исчезают во время удержания ползунка.',
|
||||||
|
'Сброс яркости: при выходе из полноэкранного режима системный уровень яркости экрана аккуратно восстанавливается.',
|
||||||
|
],
|
||||||
|
),
|
||||||
|
LunarisChange(
|
||||||
|
version: '3.1.8',
|
||||||
|
title: 'Безупречный полноэкранный плеер: устранение остановки при развертывании и отзывчивые кнопки управления',
|
||||||
|
bullets: [
|
||||||
|
'Непрерывное воспроизведение при открытии на весь экран: видео больше не останавливается самопроизвольно при входе в полноэкранный режим или смене ориентации устройства.',
|
||||||
|
'Корректный статус воспроизведения: устранен сброс кнопки на «Пуск» при переходе в полный экран — видео продолжает воспроизведение без ложных остановок.',
|
||||||
|
'Мгновенный отклик кнопок «Пуск/Пауза» и перемотки: жесты управления поверхностью (двойной тап, смахивание громкости) перемещены в фоновый слой, исключая перехват и отмену нажатий по кнопкам управления.',
|
||||||
|
'Синхронизация состояния при сворачивании: плеер точно запоминает состояние паузы/воспроизведения при выходе из полноэкранного режима обратно в пост.',
|
||||||
|
],
|
||||||
|
),
|
||||||
|
LunarisChange(
|
||||||
|
version: '3.1.7',
|
||||||
|
title: 'Устранение критического сбоя при открытии видеопоста (SIGSEGV в libmpv)',
|
||||||
|
bullets: [
|
||||||
|
'Устранение нативного вылета: полностью удалены небезопасные прямые FFI-вызовы setProperty к mpv, приводившие к немедленному падению приложения на Android при инициализации видео.',
|
||||||
|
'Безопасная конфигурация декодирования: перевод настроек аппаратного ускорения и фоллбэка кодеков на официальный типобезопасный VideoControllerConfiguration (media_kit_video).',
|
||||||
|
'Надежный фоллбэк при редких ошибках кодека: при несовместимости аппаратного декодера плеер бесшовно переключается на программный FFmpeg-декодер без риска краша.',
|
||||||
|
],
|
||||||
|
),
|
||||||
LunarisChange(
|
LunarisChange(
|
||||||
version: '3.1.6',
|
version: '3.1.6',
|
||||||
title: 'Надежный полноэкранный плеер, сохранение провайдеров в поиске, громкость и устранение ошибки кодека',
|
title: 'Надежный полноэкранный плеер, сохранение провайдеров в поиске, громкость и устранение ошибки кодека',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:media_kit/media_kit.dart';
|
import 'package:media_kit/media_kit.dart';
|
||||||
import 'package:media_kit_video/media_kit_video.dart';
|
import 'package:media_kit_video/media_kit_video.dart';
|
||||||
|
import 'package:screen_brightness/screen_brightness.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
import '../../../../app/motion.dart';
|
import '../../../../app/motion.dart';
|
||||||
@@ -75,6 +76,7 @@ class _PostMediaViewerState extends State<PostMediaViewer>
|
|||||||
late double _currentVolume;
|
late double _currentVolume;
|
||||||
String? _videoError;
|
String? _videoError;
|
||||||
bool _retriedFormatError = false;
|
bool _retriedFormatError = false;
|
||||||
|
bool _softwareDecodingFallback = false;
|
||||||
Timer? _hideTimer;
|
Timer? _hideTimer;
|
||||||
StreamSubscription<String>? _errorSubscription;
|
StreamSubscription<String>? _errorSubscription;
|
||||||
StreamSubscription<Duration>? _positionSubscription;
|
StreamSubscription<Duration>? _positionSubscription;
|
||||||
@@ -105,6 +107,7 @@ class _PostMediaViewerState extends State<PostMediaViewer>
|
|||||||
_videoIndex = 0;
|
_videoIndex = 0;
|
||||||
_videoError = null;
|
_videoError = null;
|
||||||
_retriedFormatError = false;
|
_retriedFormatError = false;
|
||||||
|
_softwareDecodingFallback = false;
|
||||||
_imageUrls = _buildImageUrls(widget.post);
|
_imageUrls = _buildImageUrls(widget.post);
|
||||||
_videoUrls = _buildVideoUrls(widget.post);
|
_videoUrls = _buildVideoUrls(widget.post);
|
||||||
if (_isVideo(widget.post) && _videoUrls.isNotEmpty) {
|
if (_isVideo(widget.post) && _videoUrls.isNotEmpty) {
|
||||||
@@ -359,13 +362,13 @@ class _PostMediaViewerState extends State<PostMediaViewer>
|
|||||||
void _initializeVideo() {
|
void _initializeVideo() {
|
||||||
MediaKit.ensureInitialized();
|
MediaKit.ensureInitialized();
|
||||||
_player = Player();
|
_player = Player();
|
||||||
_controller = VideoController(_player!);
|
_controller = VideoController(
|
||||||
try {
|
_player!,
|
||||||
final native = _player!.platform as dynamic;
|
configuration: VideoControllerConfiguration(
|
||||||
native?.setProperty('hwdec', 'auto-safe', waitForInitialization: false);
|
enableHardwareAcceleration: !_softwareDecodingFallback,
|
||||||
native?.setProperty('vd-lavc-software-fallback', 'yes', waitForInitialization: false);
|
hwdec: _softwareDecodingFallback ? 'no' : 'auto-safe',
|
||||||
native?.setProperty('vd-lavc-check-hw-profile', 'yes', waitForInitialization: false);
|
),
|
||||||
} catch (_) {}
|
);
|
||||||
_applyVolume();
|
_applyVolume();
|
||||||
_player!.setPlaylistMode(
|
_player!.setPlaylistMode(
|
||||||
_loopVideo ? PlaylistMode.single : PlaylistMode.none,
|
_loopVideo ? PlaylistMode.single : PlaylistMode.none,
|
||||||
@@ -437,14 +440,12 @@ class _PostMediaViewerState extends State<PostMediaViewer>
|
|||||||
lower.contains('stream format not recognized') ||
|
lower.contains('stream format not recognized') ||
|
||||||
lower.contains('failed to recognize file format'))) {
|
lower.contains('failed to recognize file format'))) {
|
||||||
_retriedFormatError = true;
|
_retriedFormatError = true;
|
||||||
try {
|
_softwareDecodingFallback = true;
|
||||||
final native = _player?.platform as dynamic;
|
_disposeVideo();
|
||||||
await native?.setProperty('hwdec', 'no', waitForInitialization: false);
|
await Future<void>.delayed(const Duration(milliseconds: 250));
|
||||||
} catch (_) {}
|
if (mounted) {
|
||||||
await Future<void>.delayed(const Duration(milliseconds: 300));
|
|
||||||
if (mounted && _player != null) {
|
|
||||||
_videoIndex = 0;
|
_videoIndex = 0;
|
||||||
await _openVideo(play: play);
|
_initializeVideo();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -456,11 +457,12 @@ class _PostMediaViewerState extends State<PostMediaViewer>
|
|||||||
Future<void> _retryVideo() async {
|
Future<void> _retryVideo() async {
|
||||||
_videoIndex = 0;
|
_videoIndex = 0;
|
||||||
_retriedFormatError = false;
|
_retriedFormatError = false;
|
||||||
try {
|
_softwareDecodingFallback = true;
|
||||||
final native = _player?.platform as dynamic;
|
_disposeVideo();
|
||||||
await native?.setProperty('hwdec', 'no', waitForInitialization: false);
|
await Future<void>.delayed(const Duration(milliseconds: 150));
|
||||||
} catch (_) {}
|
if (mounted) {
|
||||||
await _openVideo(play: true);
|
_initializeVideo();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _disposeVideo() {
|
void _disposeVideo() {
|
||||||
@@ -570,15 +572,19 @@ class _PostMediaViewerState extends State<PostMediaViewer>
|
|||||||
final player = _player;
|
final player = _player;
|
||||||
final controller = _controller;
|
final controller = _controller;
|
||||||
if (player == null || controller == null) return;
|
if (player == null || controller == null) return;
|
||||||
|
final wasPlaying = player.state.playing;
|
||||||
setState(() => _inFullscreen = true);
|
setState(() => _inFullscreen = true);
|
||||||
if (!context.mounted) return;
|
if (!context.mounted) return;
|
||||||
final result = await Navigator.of(context, rootNavigator: true)
|
final result = await Navigator.of(context, rootNavigator: true)
|
||||||
.push<VideoPlaybackSnapshot>(
|
.push<VideoPlaybackSnapshot>(
|
||||||
PageRouteBuilder(
|
PageRouteBuilder(
|
||||||
opaque: true,
|
opaque: true,
|
||||||
|
transitionDuration: Duration.zero,
|
||||||
|
reverseTransitionDuration: Duration.zero,
|
||||||
pageBuilder: (_, __, ___) => _FullscreenVideoPage(
|
pageBuilder: (_, __, ___) => _FullscreenVideoPage(
|
||||||
player: player,
|
player: player,
|
||||||
controller: controller,
|
controller: controller,
|
||||||
|
wasPlaying: wasPlaying,
|
||||||
aspectRatio: widget.post.width > 0 && widget.post.height > 0
|
aspectRatio: widget.post.width > 0 && widget.post.height > 0
|
||||||
? widget.post.width / widget.post.height
|
? widget.post.width / widget.post.height
|
||||||
: 16 / 9,
|
: 16 / 9,
|
||||||
@@ -593,15 +599,16 @@ class _PostMediaViewerState extends State<PostMediaViewer>
|
|||||||
unawaited(_applyPlaybackSnapshot(snapshot));
|
unawaited(_applyPlaybackSnapshot(snapshot));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
transitionsBuilder: (_, animation, __, child) => FadeTransition(
|
|
||||||
opacity: animation,
|
|
||||||
child: child,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
if (mounted) setState(() => _inFullscreen = false);
|
if (mounted) setState(() => _inFullscreen = false);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
await _applyPlaybackSnapshot(result);
|
await _applyPlaybackSnapshot(result);
|
||||||
|
if (result.playing && !player.state.playing) {
|
||||||
|
await player.play();
|
||||||
|
} else if (!result.playing && player.state.playing) {
|
||||||
|
await player.pause();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -728,6 +735,7 @@ class _FullscreenVideoPage extends StatefulWidget {
|
|||||||
const _FullscreenVideoPage({
|
const _FullscreenVideoPage({
|
||||||
required this.player,
|
required this.player,
|
||||||
required this.controller,
|
required this.controller,
|
||||||
|
required this.wasPlaying,
|
||||||
required this.aspectRatio,
|
required this.aspectRatio,
|
||||||
required this.loopVideo,
|
required this.loopVideo,
|
||||||
required this.muted,
|
required this.muted,
|
||||||
@@ -741,6 +749,7 @@ class _FullscreenVideoPage extends StatefulWidget {
|
|||||||
|
|
||||||
final Player player;
|
final Player player;
|
||||||
final VideoController controller;
|
final VideoController controller;
|
||||||
|
final bool wasPlaying;
|
||||||
final double aspectRatio;
|
final double aspectRatio;
|
||||||
final bool loopVideo;
|
final bool loopVideo;
|
||||||
final bool muted;
|
final bool muted;
|
||||||
@@ -778,6 +787,13 @@ class _FullscreenVideoPageState extends State<_FullscreenVideoPage> {
|
|||||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
|
||||||
_applyOrientation();
|
_applyOrientation();
|
||||||
_scheduleControlsHide();
|
_scheduleControlsHide();
|
||||||
|
if (widget.wasPlaying) {
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
|
if (mounted && !widget.player.state.playing) {
|
||||||
|
widget.player.play();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _applyOrientation() {
|
void _applyOrientation() {
|
||||||
@@ -803,6 +819,9 @@ class _FullscreenVideoPageState extends State<_FullscreenVideoPage> {
|
|||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_hideTimer?.cancel();
|
_hideTimer?.cancel();
|
||||||
|
try {
|
||||||
|
ScreenBrightness.instance.resetApplicationScreenBrightness();
|
||||||
|
} catch (_) {}
|
||||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||||
SystemChrome.setPreferredOrientations(DeviceOrientation.values);
|
SystemChrome.setPreferredOrientations(DeviceOrientation.values);
|
||||||
super.dispose();
|
super.dispose();
|
||||||
@@ -1035,11 +1054,23 @@ class _VideoSurfaceState extends State<_VideoSurface> {
|
|||||||
double _currentVolume = 100;
|
double _currentVolume = 100;
|
||||||
Timer? _volumeTimer;
|
Timer? _volumeTimer;
|
||||||
|
|
||||||
|
bool _showBrightnessIndicator = false;
|
||||||
|
double _currentBrightness = 0.5;
|
||||||
|
Timer? _brightnessTimer;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_currentVolume = widget.initialVolume;
|
_currentVolume = widget.initialVolume;
|
||||||
widget.player.setVolume(_currentVolume);
|
widget.player.setVolume(_currentVolume);
|
||||||
|
_initBrightness();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _initBrightness() async {
|
||||||
|
try {
|
||||||
|
final b = await ScreenBrightness.instance.application;
|
||||||
|
if (mounted) setState(() => _currentBrightness = b);
|
||||||
|
} catch (_) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -1056,6 +1087,7 @@ class _VideoSurfaceState extends State<_VideoSurface> {
|
|||||||
_seekLeftTimer?.cancel();
|
_seekLeftTimer?.cancel();
|
||||||
_seekRightTimer?.cancel();
|
_seekRightTimer?.cancel();
|
||||||
_volumeTimer?.cancel();
|
_volumeTimer?.cancel();
|
||||||
|
_brightnessTimer?.cancel();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1127,9 +1159,24 @@ class _VideoSurfaceState extends State<_VideoSurface> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _adjustBrightness(double deltaY) async {
|
||||||
|
if (_isLocked) return;
|
||||||
|
final newB = (_currentBrightness - deltaY * 0.004).clamp(0.02, 1.0);
|
||||||
|
_currentBrightness = newB;
|
||||||
|
try {
|
||||||
|
await ScreenBrightness.instance.setApplicationScreenBrightness(newB);
|
||||||
|
} catch (_) {}
|
||||||
|
setState(() => _showBrightnessIndicator = true);
|
||||||
|
_brightnessTimer?.cancel();
|
||||||
|
_brightnessTimer = Timer(const Duration(milliseconds: 1100), () {
|
||||||
|
if (mounted) setState(() => _showBrightnessIndicator = false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final player = widget.player;
|
final player = widget.player;
|
||||||
|
Offset? lastTapDown;
|
||||||
|
|
||||||
final child = LayoutBuilder(
|
final child = LayoutBuilder(
|
||||||
builder: (context, constraints) {
|
builder: (context, constraints) {
|
||||||
@@ -1142,6 +1189,34 @@ class _VideoSurfaceState extends State<_VideoSurface> {
|
|||||||
controller: widget.controller,
|
controller: widget.controller,
|
||||||
fit: widget.coverVideo ? BoxFit.cover : BoxFit.contain,
|
fit: widget.coverVideo ? BoxFit.cover : BoxFit.contain,
|
||||||
controls: null,
|
controls: null,
|
||||||
|
pauseUponEnteringBackgroundMode: false,
|
||||||
|
resumeUponEnteringForegroundMode: false,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned.fill(
|
||||||
|
child: GestureDetector(
|
||||||
|
behavior: HitTestBehavior.opaque,
|
||||||
|
onTapDown: (details) => lastTapDown = details.localPosition,
|
||||||
|
onTap: widget.onInteract,
|
||||||
|
onDoubleTap: () {
|
||||||
|
if (lastTapDown != null) {
|
||||||
|
_onDoubleTapAt(
|
||||||
|
lastTapDown!,
|
||||||
|
MediaQuery.sizeOf(context).width,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLongPressStart: (_) => _startSpeedBoost(),
|
||||||
|
onLongPressEnd: (_) => _stopSpeedBoost(),
|
||||||
|
onVerticalDragUpdate: (details) {
|
||||||
|
final x = details.localPosition.dx;
|
||||||
|
final width = MediaQuery.sizeOf(context).width;
|
||||||
|
if (x < width * 0.45) {
|
||||||
|
_adjustBrightness(details.primaryDelta ?? 0.0);
|
||||||
|
} else if (x > width * 0.55) {
|
||||||
|
_adjustVolume(details.primaryDelta ?? 0.0);
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
StreamBuilder<bool>(
|
StreamBuilder<bool>(
|
||||||
@@ -1158,6 +1233,8 @@ class _VideoSurfaceState extends State<_VideoSurface> {
|
|||||||
_DoubleTapSeekRipple(isLeft: false, visible: _showRightSeek),
|
_DoubleTapSeekRipple(isLeft: false, visible: _showRightSeek),
|
||||||
if (_showVolumeIndicator)
|
if (_showVolumeIndicator)
|
||||||
_VolumeGestureBadge(volume: _currentVolume),
|
_VolumeGestureBadge(volume: _currentVolume),
|
||||||
|
if (_showBrightnessIndicator)
|
||||||
|
_BrightnessGestureBadge(brightness: _currentBrightness),
|
||||||
if (_isSpeedBoosted)
|
if (_isSpeedBoosted)
|
||||||
const _SpeedBoostOverlayBadge(),
|
const _SpeedBoostOverlayBadge(),
|
||||||
if (widget.errorMessage != null)
|
if (widget.errorMessage != null)
|
||||||
@@ -1198,36 +1275,16 @@ class _VideoSurfaceState extends State<_VideoSurface> {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
Offset? lastTapDown;
|
|
||||||
|
|
||||||
return MouseRegion(
|
return MouseRegion(
|
||||||
onHover: (_) => widget.onInteract(),
|
onHover: (_) => widget.onInteract(),
|
||||||
child: GestureDetector(
|
child: ClipRRect(
|
||||||
onTapDown: (details) => lastTapDown = details.localPosition,
|
borderRadius: BorderRadius.circular(widget.fullscreen ? 0 : 10),
|
||||||
onTap: widget.onInteract,
|
child: widget.fullscreen
|
||||||
onDoubleTap: () {
|
? SizedBox.expand(child: child)
|
||||||
if (lastTapDown != null) {
|
: AspectRatio(
|
||||||
_onDoubleTapAt(lastTapDown!, MediaQuery.sizeOf(context).width);
|
aspectRatio: widget.aspectRatio.clamp(0.35, 2.4),
|
||||||
}
|
child: child,
|
||||||
},
|
),
|
||||||
onLongPressStart: (_) => _startSpeedBoost(),
|
|
||||||
onLongPressEnd: (_) => _stopSpeedBoost(),
|
|
||||||
onVerticalDragUpdate: (details) {
|
|
||||||
final x = details.localPosition.dx;
|
|
||||||
final width = MediaQuery.sizeOf(context).width;
|
|
||||||
if (x > width * 0.4) {
|
|
||||||
_adjustVolume(details.primaryDelta ?? 0.0);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: ClipRRect(
|
|
||||||
borderRadius: BorderRadius.circular(widget.fullscreen ? 0 : 10),
|
|
||||||
child: widget.fullscreen
|
|
||||||
? SizedBox.expand(child: child)
|
|
||||||
: AspectRatio(
|
|
||||||
aspectRatio: widget.aspectRatio.clamp(0.35, 2.4),
|
|
||||||
child: child,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1545,32 +1602,37 @@ class _RoundControlButton extends StatelessWidget {
|
|||||||
: Colors.white;
|
: Colors.white;
|
||||||
return Tooltip(
|
return Tooltip(
|
||||||
message: tooltip,
|
message: tooltip,
|
||||||
child: GestureDetector(
|
child: Material(
|
||||||
behavior: HitTestBehavior.opaque,
|
color: Colors.transparent,
|
||||||
onTap: onPressed,
|
shape: const CircleBorder(),
|
||||||
child: AnimatedContainer(
|
child: InkResponse(
|
||||||
duration: AppMotion.duration(context, 140),
|
containedInkWell: true,
|
||||||
width: size,
|
highlightShape: BoxShape.circle,
|
||||||
height: size,
|
onTap: onPressed,
|
||||||
decoration: BoxDecoration(
|
child: AnimatedContainer(
|
||||||
color: background,
|
duration: AppMotion.duration(context, 140),
|
||||||
shape: BoxShape.circle,
|
width: size,
|
||||||
border: Border.all(
|
height: size,
|
||||||
color: selected
|
decoration: BoxDecoration(
|
||||||
? scheme.primary.withValues(alpha: 0.4)
|
color: background,
|
||||||
: Colors.white.withValues(alpha: 0.14),
|
shape: BoxShape.circle,
|
||||||
|
border: Border.all(
|
||||||
|
color: selected
|
||||||
|
? scheme.primary.withValues(alpha: 0.4)
|
||||||
|
: Colors.white.withValues(alpha: 0.14),
|
||||||
|
),
|
||||||
|
boxShadow: [
|
||||||
|
if (emphasized)
|
||||||
|
BoxShadow(
|
||||||
|
color: scheme.primary.withValues(alpha: 0.45),
|
||||||
|
blurRadius: 28,
|
||||||
|
spreadRadius: 2,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Icon(icon, color: foreground, size: iconSize),
|
||||||
),
|
),
|
||||||
boxShadow: [
|
|
||||||
if (emphasized)
|
|
||||||
BoxShadow(
|
|
||||||
color: scheme.primary.withValues(alpha: 0.45),
|
|
||||||
blurRadius: 28,
|
|
||||||
spreadRadius: 2,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Center(
|
|
||||||
child: Icon(icon, color: foreground, size: iconSize),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1752,6 +1814,68 @@ class _VolumeGestureBadge extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class _BrightnessGestureBadge extends StatelessWidget {
|
||||||
|
const _BrightnessGestureBadge({required this.brightness});
|
||||||
|
|
||||||
|
final double brightness;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final pct = (brightness * 100).round().clamp(0, 100);
|
||||||
|
final icon = pct < 33
|
||||||
|
? Icons.brightness_low_rounded
|
||||||
|
: pct < 66
|
||||||
|
? Icons.brightness_medium_rounded
|
||||||
|
: Icons.brightness_high_rounded;
|
||||||
|
|
||||||
|
return Center(
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 18, vertical: 12),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.black.withValues(alpha: 0.8),
|
||||||
|
borderRadius: BorderRadius.circular(22),
|
||||||
|
border: Border.all(color: Colors.white.withValues(alpha: 0.16)),
|
||||||
|
boxShadow: const [
|
||||||
|
BoxShadow(color: Colors.black54, blurRadius: 24),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
icon,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 26,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
SizedBox(
|
||||||
|
width: 96,
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
child: LinearProgressIndicator(
|
||||||
|
value: brightness.clamp(0.0, 1.0),
|
||||||
|
minHeight: 6,
|
||||||
|
backgroundColor: Colors.white24,
|
||||||
|
valueColor: const AlwaysStoppedAnimation(Colors.white),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
Text(
|
||||||
|
'$pct%',
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.w800,
|
||||||
|
fontSize: 13,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class _DoubleTapSeekRipple extends StatelessWidget {
|
class _DoubleTapSeekRipple extends StatelessWidget {
|
||||||
const _DoubleTapSeekRipple({
|
const _DoubleTapSeekRipple({
|
||||||
required this.isLeft,
|
required this.isLeft,
|
||||||
@@ -1811,7 +1935,7 @@ class _DoubleTapSeekRipple extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _VideoControls extends StatelessWidget {
|
class _VideoControls extends StatefulWidget {
|
||||||
const _VideoControls({
|
const _VideoControls({
|
||||||
required this.player,
|
required this.player,
|
||||||
required this.muted,
|
required this.muted,
|
||||||
@@ -1846,11 +1970,18 @@ class _VideoControls extends StatelessWidget {
|
|||||||
final void Function(Duration) onSeekBy;
|
final void Function(Duration) onSeekBy;
|
||||||
final VoidCallback? onInteract;
|
final VoidCallback? onInteract;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<_VideoControls> createState() => _VideoControlsState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _VideoControlsState extends State<_VideoControls> {
|
||||||
|
double? _scrubValue;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final scheme = Theme.of(context).colorScheme;
|
final scheme = Theme.of(context).colorScheme;
|
||||||
|
|
||||||
if (isLocked) {
|
if (widget.isLocked) {
|
||||||
return Align(
|
return Align(
|
||||||
alignment: Alignment.topLeft,
|
alignment: Alignment.topLeft,
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
@@ -1862,7 +1993,7 @@ class _VideoControls extends StatelessWidget {
|
|||||||
size: 44,
|
size: 44,
|
||||||
iconSize: 24,
|
iconSize: 24,
|
||||||
emphasized: true,
|
emphasized: true,
|
||||||
onPressed: onToggleLock,
|
onPressed: widget.onToggleLock,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1870,8 +2001,8 @@ class _VideoControls extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return StreamBuilder<double>(
|
return StreamBuilder<double>(
|
||||||
stream: player.stream.rate,
|
stream: widget.player.stream.rate,
|
||||||
initialData: player.state.rate,
|
initialData: widget.player.state.rate,
|
||||||
builder: (context, rateSnapshot) {
|
builder: (context, rateSnapshot) {
|
||||||
final currentRate = rateSnapshot.data ?? 1.0;
|
final currentRate = rateSnapshot.data ?? 1.0;
|
||||||
|
|
||||||
@@ -1893,56 +2024,56 @@ class _VideoControls extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
top: fullscreen,
|
top: widget.fullscreen,
|
||||||
bottom: false,
|
bottom: false,
|
||||||
left: fullscreen,
|
left: widget.fullscreen,
|
||||||
right: fullscreen,
|
right: widget.fullscreen,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (fullscreen) ...[
|
if (widget.fullscreen) ...[
|
||||||
_RoundControlButton(
|
_RoundControlButton(
|
||||||
tooltip: 'Закрыть',
|
tooltip: 'Закрыть',
|
||||||
icon: Icons.arrow_back_rounded,
|
icon: Icons.arrow_back_rounded,
|
||||||
onPressed: onFullscreen,
|
onPressed: widget.onFullscreen,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
],
|
],
|
||||||
_RoundControlButton(
|
_RoundControlButton(
|
||||||
tooltip: 'Заблокировать экран',
|
tooltip: 'Заблокировать экран',
|
||||||
icon: Icons.lock_outline_rounded,
|
icon: Icons.lock_outline_rounded,
|
||||||
onPressed: onToggleLock,
|
onPressed: widget.onToggleLock,
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
_SpeedBadgeButton(
|
_SpeedBadgeButton(
|
||||||
currentRate: currentRate,
|
currentRate: currentRate,
|
||||||
onSelected: (newRate) => player.setRate(newRate),
|
onSelected: (newRate) => widget.player.setRate(newRate),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
_RoundControlButton(
|
_RoundControlButton(
|
||||||
tooltip: loopVideo ? 'Выключить повтор' : 'Повтор видео',
|
tooltip: widget.loopVideo ? 'Выключить повтор' : 'Повтор видео',
|
||||||
selected: loopVideo,
|
selected: widget.loopVideo,
|
||||||
icon: loopVideo
|
icon: widget.loopVideo
|
||||||
? Icons.repeat_one_on_rounded
|
? Icons.repeat_one_on_rounded
|
||||||
: Icons.repeat_one_rounded,
|
: Icons.repeat_one_rounded,
|
||||||
onPressed: onToggleLoop,
|
onPressed: widget.onToggleLoop,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
_RoundControlButton(
|
_RoundControlButton(
|
||||||
tooltip: coverVideo ? 'Вписать' : 'Заполнить',
|
tooltip: widget.coverVideo ? 'Вписать' : 'Заполнить',
|
||||||
selected: coverVideo,
|
selected: widget.coverVideo,
|
||||||
icon: coverVideo
|
icon: widget.coverVideo
|
||||||
? Icons.fit_screen_rounded
|
? Icons.fit_screen_rounded
|
||||||
: Icons.crop_free_rounded,
|
: Icons.crop_free_rounded,
|
||||||
onPressed: onToggleFit,
|
onPressed: widget.onToggleFit,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
_RoundControlButton(
|
_RoundControlButton(
|
||||||
tooltip: muted ? 'Включить звук' : 'Выключить звук',
|
tooltip: widget.muted ? 'Включить звук' : 'Выключить звук',
|
||||||
selected: !muted,
|
selected: !widget.muted,
|
||||||
icon: muted
|
icon: widget.muted
|
||||||
? Icons.volume_off_rounded
|
? Icons.volume_off_rounded
|
||||||
: Icons.volume_up_rounded,
|
: Icons.volume_up_rounded,
|
||||||
onPressed: onToggleMute,
|
onPressed: widget.onToggleMute,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -1953,8 +2084,8 @@ class _VideoControls extends StatelessWidget {
|
|||||||
// Center play/pause with quick 10s buttons
|
// Center play/pause with quick 10s buttons
|
||||||
Center(
|
Center(
|
||||||
child: StreamBuilder<bool>(
|
child: StreamBuilder<bool>(
|
||||||
stream: player.stream.playing,
|
stream: widget.player.stream.playing,
|
||||||
initialData: player.state.playing,
|
initialData: widget.player.state.playing,
|
||||||
builder: (context, playingSnapshot) {
|
builder: (context, playingSnapshot) {
|
||||||
final playing = playingSnapshot.data ?? false;
|
final playing = playingSnapshot.data ?? false;
|
||||||
return Row(
|
return Row(
|
||||||
@@ -1966,8 +2097,8 @@ class _VideoControls extends StatelessWidget {
|
|||||||
size: 46,
|
size: 46,
|
||||||
iconSize: 26,
|
iconSize: 26,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
onSeekBy(const Duration(seconds: -10));
|
widget.onSeekBy(const Duration(seconds: -10));
|
||||||
onInteract?.call();
|
widget.onInteract?.call();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(width: 32),
|
const SizedBox(width: 32),
|
||||||
@@ -1981,20 +2112,22 @@ class _VideoControls extends StatelessWidget {
|
|||||||
emphasized: true,
|
emphasized: true,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
try {
|
try {
|
||||||
if (player.state.completed) {
|
if (widget.player.state.playing) {
|
||||||
await player.seek(Duration.zero);
|
await widget.player.pause();
|
||||||
await player.play();
|
|
||||||
} else {
|
} else {
|
||||||
await player.playOrPause();
|
if (widget.player.state.completed) {
|
||||||
|
await widget.player.seek(Duration.zero);
|
||||||
|
}
|
||||||
|
await widget.player.play();
|
||||||
}
|
}
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
if (player.state.playing) {
|
if (widget.player.state.playing) {
|
||||||
await player.pause();
|
await widget.player.pause();
|
||||||
} else {
|
} else {
|
||||||
await player.play();
|
await widget.player.play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onInteract?.call();
|
widget.onInteract?.call();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(width: 32),
|
const SizedBox(width: 32),
|
||||||
@@ -2004,8 +2137,8 @@ class _VideoControls extends StatelessWidget {
|
|||||||
size: 46,
|
size: 46,
|
||||||
iconSize: 26,
|
iconSize: 26,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
onSeekBy(const Duration(seconds: 10));
|
widget.onSeekBy(const Duration(seconds: 10));
|
||||||
onInteract?.call();
|
widget.onInteract?.call();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -2024,7 +2157,7 @@ class _VideoControls extends StatelessWidget {
|
|||||||
14,
|
14,
|
||||||
8,
|
8,
|
||||||
14,
|
14,
|
||||||
fullscreen ? 10 : 4,
|
widget.fullscreen ? 10 : 4,
|
||||||
),
|
),
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
@@ -2035,23 +2168,23 @@ class _VideoControls extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
top: false,
|
top: false,
|
||||||
bottom: fullscreen,
|
bottom: widget.fullscreen,
|
||||||
left: fullscreen,
|
left: widget.fullscreen,
|
||||||
right: fullscreen,
|
right: widget.fullscreen,
|
||||||
child: StreamBuilder<Duration>(
|
child: StreamBuilder<Duration>(
|
||||||
stream: player.stream.duration,
|
stream: widget.player.stream.duration,
|
||||||
initialData: player.state.duration,
|
initialData: widget.player.state.duration,
|
||||||
builder: (context, durationSnapshot) {
|
builder: (context, durationSnapshot) {
|
||||||
final duration = durationSnapshot.data ?? Duration.zero;
|
final duration = durationSnapshot.data ?? Duration.zero;
|
||||||
return StreamBuilder<Duration>(
|
return StreamBuilder<Duration>(
|
||||||
stream: player.stream.position,
|
stream: widget.player.stream.position,
|
||||||
initialData: player.state.position,
|
initialData: widget.player.state.position,
|
||||||
builder: (context, positionSnapshot) {
|
builder: (context, positionSnapshot) {
|
||||||
final position =
|
final position =
|
||||||
positionSnapshot.data ?? Duration.zero;
|
positionSnapshot.data ?? Duration.zero;
|
||||||
return StreamBuilder<Duration>(
|
return StreamBuilder<Duration>(
|
||||||
stream: player.stream.buffer,
|
stream: widget.player.stream.buffer,
|
||||||
initialData: player.state.buffer,
|
initialData: widget.player.state.buffer,
|
||||||
builder: (context, bufferSnapshot) {
|
builder: (context, bufferSnapshot) {
|
||||||
final buffer =
|
final buffer =
|
||||||
bufferSnapshot.data ?? Duration.zero;
|
bufferSnapshot.data ?? Duration.zero;
|
||||||
@@ -2064,99 +2197,153 @@ class _VideoControls extends StatelessWidget {
|
|||||||
final bufferMs = buffer.inMilliseconds
|
final bufferMs = buffer.inMilliseconds
|
||||||
.clamp(0, maxMs.toInt())
|
.clamp(0, maxMs.toInt())
|
||||||
.toDouble();
|
.toDouble();
|
||||||
|
final displayMs =
|
||||||
|
(_scrubValue ?? valueMs).clamp(0.0, maxMs);
|
||||||
|
|
||||||
return Row(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
if (_scrubValue != null)
|
||||||
_format(position),
|
Container(
|
||||||
style: const TextStyle(
|
padding: const EdgeInsets.symmetric(
|
||||||
color: Colors.white,
|
horizontal: 10,
|
||||||
fontSize: 12,
|
vertical: 4,
|
||||||
fontWeight: FontWeight.w800,
|
),
|
||||||
letterSpacing: 0.3,
|
margin: const EdgeInsets.only(bottom: 6),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.black87,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(
|
||||||
|
color: scheme.primary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'${_format(Duration(milliseconds: displayMs.round()))} / ${_format(duration)}',
|
||||||
|
style: TextStyle(
|
||||||
|
color: scheme.primary,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Row(
|
||||||
const SizedBox(width: 4),
|
crossAxisAlignment:
|
||||||
Expanded(
|
CrossAxisAlignment.center,
|
||||||
child: Stack(
|
children: [
|
||||||
alignment: Alignment.center,
|
Text(
|
||||||
children: [
|
_format(Duration(
|
||||||
// Buffer progress track
|
milliseconds: displayMs.round())),
|
||||||
if (maxMs > 0 && bufferMs > 0)
|
style: const TextStyle(
|
||||||
Positioned(
|
color: Colors.white,
|
||||||
left: 14,
|
fontSize: 12,
|
||||||
right: 14,
|
fontWeight: FontWeight.w800,
|
||||||
child: ClipRRect(
|
letterSpacing: 0.3,
|
||||||
borderRadius:
|
),
|
||||||
BorderRadius.circular(2),
|
),
|
||||||
child: LinearProgressIndicator(
|
const SizedBox(width: 4),
|
||||||
value: (bufferMs / maxMs)
|
Expanded(
|
||||||
.clamp(0.0, 1.0),
|
child: Stack(
|
||||||
minHeight: 3.5,
|
alignment: Alignment.center,
|
||||||
backgroundColor:
|
children: [
|
||||||
Colors.transparent,
|
// Buffer progress track
|
||||||
valueColor:
|
if (maxMs > 0 && bufferMs > 0)
|
||||||
AlwaysStoppedAnimation(
|
Positioned(
|
||||||
Colors.white
|
left: 14,
|
||||||
.withValues(alpha: 0.28),
|
right: 14,
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(2),
|
||||||
|
child:
|
||||||
|
LinearProgressIndicator(
|
||||||
|
value: (bufferMs / maxMs)
|
||||||
|
.clamp(0.0, 1.0),
|
||||||
|
minHeight: 3.5,
|
||||||
|
backgroundColor:
|
||||||
|
Colors.transparent,
|
||||||
|
valueColor:
|
||||||
|
AlwaysStoppedAnimation(
|
||||||
|
Colors.white.withValues(
|
||||||
|
alpha: 0.28),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
SliderTheme(
|
||||||
),
|
data: SliderTheme.of(context)
|
||||||
SliderTheme(
|
.copyWith(
|
||||||
data: SliderTheme.of(context).copyWith(
|
activeTrackColor:
|
||||||
activeTrackColor: scheme.primary,
|
scheme.primary,
|
||||||
inactiveTrackColor: Colors.white
|
inactiveTrackColor: Colors.white
|
||||||
.withValues(alpha: 0.2),
|
.withValues(alpha: 0.2),
|
||||||
trackHeight: 3.5,
|
trackHeight: 3.5,
|
||||||
thumbColor: scheme.primary,
|
thumbColor: scheme.primary,
|
||||||
overlayColor: scheme.primary
|
overlayColor: scheme.primary
|
||||||
.withValues(alpha: 0.22),
|
.withValues(alpha: 0.22),
|
||||||
thumbShape:
|
thumbShape:
|
||||||
const RoundSliderThumbShape(
|
const RoundSliderThumbShape(
|
||||||
enabledThumbRadius: 6,
|
enabledThumbRadius: 6,
|
||||||
),
|
),
|
||||||
overlayShape:
|
overlayShape:
|
||||||
const RoundSliderOverlayShape(
|
const RoundSliderOverlayShape(
|
||||||
overlayRadius: 14,
|
overlayRadius: 14,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Slider(
|
child: Slider(
|
||||||
value: valueMs,
|
value: displayMs,
|
||||||
max: maxMs,
|
max: maxMs,
|
||||||
onChanged: duration == Duration.zero
|
onChangeStart: (value) {
|
||||||
? null
|
setState(() =>
|
||||||
: (value) => player.seek(
|
_scrubValue = value);
|
||||||
Duration(
|
widget.onInteract?.call();
|
||||||
milliseconds:
|
},
|
||||||
value.round(),
|
onChanged: duration ==
|
||||||
),
|
Duration.zero
|
||||||
|
? null
|
||||||
|
: (value) {
|
||||||
|
setState(() =>
|
||||||
|
_scrubValue =
|
||||||
|
value);
|
||||||
|
widget.onInteract
|
||||||
|
?.call();
|
||||||
|
},
|
||||||
|
onChangeEnd: (value) {
|
||||||
|
widget.player.seek(
|
||||||
|
Duration(
|
||||||
|
milliseconds:
|
||||||
|
value.round(),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
|
setState(
|
||||||
|
() => _scrubValue = null);
|
||||||
|
widget.onInteract?.call();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
const SizedBox(width: 4),
|
||||||
),
|
Text(
|
||||||
const SizedBox(width: 4),
|
_format(duration),
|
||||||
Text(
|
style: TextStyle(
|
||||||
_format(duration),
|
color: Colors.white
|
||||||
style: TextStyle(
|
.withValues(alpha: 0.72),
|
||||||
color: Colors.white.withValues(alpha: 0.72),
|
fontSize: 12,
|
||||||
fontSize: 12,
|
fontWeight: FontWeight.w700,
|
||||||
fontWeight: FontWeight.w700,
|
letterSpacing: 0.3,
|
||||||
letterSpacing: 0.3,
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(width: 8),
|
||||||
const SizedBox(width: 8),
|
_RoundControlButton(
|
||||||
_RoundControlButton(
|
tooltip: widget.fullscreen
|
||||||
tooltip: fullscreen
|
? 'Выйти из полноэкранного режима'
|
||||||
? 'Выйти из полноэкранного режима'
|
: 'Полноэкранный режим',
|
||||||
: 'Полноэкранный режим',
|
icon: widget.fullscreen
|
||||||
icon: fullscreen
|
? Icons.fullscreen_exit_rounded
|
||||||
? Icons.fullscreen_exit_rounded
|
: Icons.fullscreen_rounded,
|
||||||
: Icons.fullscreen_rounded,
|
onPressed: widget.onFullscreen,
|
||||||
onPressed: onFullscreen,
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -596,6 +596,8 @@ class _FeedVideoPreviewState extends State<_FeedVideoPreview> {
|
|||||||
controller: _controller,
|
controller: _controller,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
controls: null,
|
controls: null,
|
||||||
|
pauseUponEnteringBackgroundMode: false,
|
||||||
|
resumeUponEnteringForegroundMode: false,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
+43
-3
@@ -895,11 +895,43 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.3"
|
version: "2.0.3"
|
||||||
|
screen_brightness:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: screen_brightness
|
||||||
|
sha256: e0edf92c08889e8f493cde291e7c687db2b4a1471f2371c074070b75d7c7d79b
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.11"
|
||||||
screen_brightness_android:
|
screen_brightness_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: screen_brightness_android
|
name: screen_brightness_android
|
||||||
sha256: "2df5e0488a22a73271a43d92dbcd80643df6910cf69690faacaf9929ae9ade3b"
|
sha256: "2008ad8e9527cc968f7a4de1ec58b476d495b3c612a149dbd6550c4f046da147"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.6"
|
||||||
|
screen_brightness_ios:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: screen_brightness_ios
|
||||||
|
sha256: "352d355e8523a186ba1e494b74218e5ca96e51975a0630b8ed89fbb7ff609762"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.4"
|
||||||
|
screen_brightness_macos:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: screen_brightness_macos
|
||||||
|
sha256: b0957237b842d846a84363b69f229b339a8f91faced55041e245b2ebff7b0142
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.4"
|
||||||
|
screen_brightness_ohos:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: screen_brightness_ohos
|
||||||
|
sha256: "569a2c97909a50894b81487619eb7654f5358443a5af05f840c19261f49c0940"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.4"
|
version: "2.1.4"
|
||||||
@@ -907,10 +939,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: screen_brightness_platform_interface
|
name: screen_brightness_platform_interface
|
||||||
sha256: "59d50850d6735d677780fc7359c8e997d0ff6df91c8465161c9e617a7b0a11d8"
|
sha256: "2de60c0ba569b898950029cc1f7e9dd72bda44a22beb5054aac331cb6fce2ff2"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.1"
|
version: "2.1.2"
|
||||||
|
screen_brightness_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: screen_brightness_windows
|
||||||
|
sha256: "368b9c822e1671de81616e48150006e39eff2a434957e47ee638b09a32b2297c"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.2"
|
||||||
share_plus:
|
share_plus:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|||||||
+2
-1
@@ -1,7 +1,7 @@
|
|||||||
name: gel_rule_app
|
name: gel_rule_app
|
||||||
description: Local backend/core layer for a Flutter booru browser app.
|
description: Local backend/core layer for a Flutter booru browser app.
|
||||||
publish_to: "none"
|
publish_to: "none"
|
||||||
version: 3.1.6+67
|
version: 3.1.9+70
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.3.0 <4.0.0"
|
sdk: ">=3.3.0 <4.0.0"
|
||||||
@@ -33,6 +33,7 @@ dependencies:
|
|||||||
media_kit_libs_android_video: ^1.3.8
|
media_kit_libs_android_video: ^1.3.8
|
||||||
share_plus: ^10.0.0
|
share_plus: ^10.0.0
|
||||||
dynamic_color: ^1.7.0
|
dynamic_color: ^1.7.0
|
||||||
|
screen_brightness: ^2.1.11
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|||||||
Reference in New Issue
Block a user