fix: fullscreen playback state retention and responsive control buttons (v3.1.8)
Build and Release / Build Windows x64 (push) Has been cancelled
Build and Release / Build Windows x64 (push) Has been cancelled
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/RarDog/Lunaris/releases"><img src="https://img.shields.io/badge/Version-3.1.7-8A2BE2?style=for-the-badge&logo=semver&logoColor=white" alt="Version 3.1.7" /></a>
|
||||
<a href="https://github.com/RarDog/Lunaris/releases"><img src="https://img.shields.io/badge/Version-3.1.8-8A2BE2?style=for-the-badge&logo=semver&logoColor=white" alt="Version 3.1.8" /></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/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>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
const appDisplayVersion = '3.1.7';
|
||||
const appBuildNumber = 68;
|
||||
const appDisplayVersion = '3.1.8';
|
||||
const appBuildNumber = 69;
|
||||
const appReleaseChannel = 'Stable';
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
const lunarisChangelog = [
|
||||
LunarisChange(
|
||||
version: '3.1.8',
|
||||
title: 'Безупречный полноэкранный плеер: устранение остановки при развертывании и отзывчивые кнопки управления',
|
||||
bullets: [
|
||||
'Непрерывное воспроизведение при открытии на весь экран: видео больше не останавливается самопроизвольно при входе в полноэкранный режим или смене ориентации устройства.',
|
||||
'Корректный статус воспроизведения: устранен сброс кнопки на «Пуск» при переходе в полный экран — видео продолжает воспроизведение без ложных остановок.',
|
||||
'Мгновенный отклик кнопок «Пуск/Пауза» и перемотки: жесты управления поверхностью (двойной тап, смахивание громкости) перемещены в фоновый слой, исключая перехват и отмену нажатий по кнопкам управления.',
|
||||
'Синхронизация состояния при сворачивании: плеер точно запоминает состояние паузы/воспроизведения при выходе из полноэкранного режима обратно в пост.',
|
||||
],
|
||||
),
|
||||
LunarisChange(
|
||||
version: '3.1.7',
|
||||
title: 'Устранение критического сбоя при открытии видеопоста (SIGSEGV в libmpv)',
|
||||
|
||||
@@ -571,6 +571,7 @@ class _PostMediaViewerState extends State<PostMediaViewer>
|
||||
final player = _player;
|
||||
final controller = _controller;
|
||||
if (player == null || controller == null) return;
|
||||
final wasPlaying = player.state.playing;
|
||||
setState(() => _inFullscreen = true);
|
||||
if (!context.mounted) return;
|
||||
final result = await Navigator.of(context, rootNavigator: true)
|
||||
@@ -580,6 +581,7 @@ class _PostMediaViewerState extends State<PostMediaViewer>
|
||||
pageBuilder: (_, __, ___) => _FullscreenVideoPage(
|
||||
player: player,
|
||||
controller: controller,
|
||||
wasPlaying: wasPlaying,
|
||||
aspectRatio: widget.post.width > 0 && widget.post.height > 0
|
||||
? widget.post.width / widget.post.height
|
||||
: 16 / 9,
|
||||
@@ -603,6 +605,11 @@ class _PostMediaViewerState extends State<PostMediaViewer>
|
||||
if (mounted) setState(() => _inFullscreen = false);
|
||||
if (result != null) {
|
||||
await _applyPlaybackSnapshot(result);
|
||||
if (result.playing && !player.state.playing) {
|
||||
await player.play();
|
||||
} else if (!result.playing && player.state.playing) {
|
||||
await player.pause();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -729,6 +736,7 @@ class _FullscreenVideoPage extends StatefulWidget {
|
||||
const _FullscreenVideoPage({
|
||||
required this.player,
|
||||
required this.controller,
|
||||
required this.wasPlaying,
|
||||
required this.aspectRatio,
|
||||
required this.loopVideo,
|
||||
required this.muted,
|
||||
@@ -742,6 +750,7 @@ class _FullscreenVideoPage extends StatefulWidget {
|
||||
|
||||
final Player player;
|
||||
final VideoController controller;
|
||||
final bool wasPlaying;
|
||||
final double aspectRatio;
|
||||
final bool loopVideo;
|
||||
final bool muted;
|
||||
@@ -779,6 +788,13 @@ class _FullscreenVideoPageState extends State<_FullscreenVideoPage> {
|
||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
|
||||
_applyOrientation();
|
||||
_scheduleControlsHide();
|
||||
if (widget.wasPlaying) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted && !widget.player.state.playing) {
|
||||
widget.player.play();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void _applyOrientation() {
|
||||
@@ -1131,6 +1147,7 @@ class _VideoSurfaceState extends State<_VideoSurface> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final player = widget.player;
|
||||
Offset? lastTapDown;
|
||||
|
||||
final child = LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
@@ -1143,6 +1160,32 @@ class _VideoSurfaceState extends State<_VideoSurface> {
|
||||
controller: widget.controller,
|
||||
fit: widget.coverVideo ? BoxFit.cover : BoxFit.contain,
|
||||
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.4) {
|
||||
_adjustVolume(details.primaryDelta ?? 0.0);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
StreamBuilder<bool>(
|
||||
@@ -1199,27 +1242,8 @@ class _VideoSurfaceState extends State<_VideoSurface> {
|
||||
},
|
||||
);
|
||||
|
||||
Offset? lastTapDown;
|
||||
|
||||
return MouseRegion(
|
||||
onHover: (_) => widget.onInteract(),
|
||||
child: GestureDetector(
|
||||
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.4) {
|
||||
_adjustVolume(details.primaryDelta ?? 0.0);
|
||||
}
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(widget.fullscreen ? 0 : 10),
|
||||
child: widget.fullscreen
|
||||
@@ -1229,7 +1253,6 @@ class _VideoSurfaceState extends State<_VideoSurface> {
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1546,8 +1569,12 @@ class _RoundControlButton extends StatelessWidget {
|
||||
: Colors.white;
|
||||
return Tooltip(
|
||||
message: tooltip,
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
shape: const CircleBorder(),
|
||||
child: InkResponse(
|
||||
containedInkWell: true,
|
||||
highlightShape: BoxShape.circle,
|
||||
onTap: onPressed,
|
||||
child: AnimatedContainer(
|
||||
duration: AppMotion.duration(context, 140),
|
||||
@@ -1575,6 +1602,7 @@ class _RoundControlButton extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1982,11 +2010,13 @@ class _VideoControls extends StatelessWidget {
|
||||
emphasized: true,
|
||||
onPressed: () async {
|
||||
try {
|
||||
if (player.state.playing) {
|
||||
await player.pause();
|
||||
} else {
|
||||
if (player.state.completed) {
|
||||
await player.seek(Duration.zero);
|
||||
}
|
||||
await player.play();
|
||||
} else {
|
||||
await player.playOrPause();
|
||||
}
|
||||
} catch (_) {
|
||||
if (player.state.playing) {
|
||||
|
||||
@@ -596,6 +596,8 @@ class _FeedVideoPreviewState extends State<_FeedVideoPreview> {
|
||||
controller: _controller,
|
||||
fit: BoxFit.cover,
|
||||
controls: null,
|
||||
pauseUponEnteringBackgroundMode: false,
|
||||
resumeUponEnteringForegroundMode: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
name: gel_rule_app
|
||||
description: Local backend/core layer for a Flutter booru browser app.
|
||||
publish_to: "none"
|
||||
version: 3.1.7+68
|
||||
version: 3.1.8+69
|
||||
|
||||
environment:
|
||||
sdk: ">=3.3.0 <4.0.0"
|
||||
|
||||
Reference in New Issue
Block a user