fix: eliminate video player blue screen on desktop with software rendering default and decoder toggle (v3.6.4)
Build and Release / Build Windows x64 (push) Has been cancelled
Build and Release / Build macOS (push) Has been cancelled

This commit is contained in:
2026-09-05 18:48:33 +03:00
parent 4aedde9b3f
commit 8ad36e2f6b
5 changed files with 115 additions and 24 deletions
+1 -1
View File
@@ -580,7 +580,7 @@ class _DesktopShellState extends State<_DesktopShell>
),
),
child: Text(
'v3.6.3',
'v3.6.4',
style: TextStyle(
fontSize: 10,
fontWeight:
+17 -10
View File
@@ -1,5 +1,6 @@
import 'dart:async';
import 'dart:collection';
import 'dart:io';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
@@ -590,7 +591,15 @@ class _FeedVideoPreviewState extends State<_FeedVideoPreview> {
super.initState();
MediaKit.ensureInitialized();
_player = Player();
_controller = VideoController(_player);
final isDesktop =
Platform.isLinux || Platform.isWindows || Platform.isMacOS;
_controller = VideoController(
_player,
configuration: VideoControllerConfiguration(
enableHardwareAcceleration: !isDesktop,
hwdec: isDesktop ? 'no' : 'auto-safe',
),
);
_player.stream.error.listen((_) {
if (mounted) setState(() => _failed = true);
});
@@ -633,15 +642,13 @@ class _FeedVideoPreviewState extends State<_FeedVideoPreview> {
AnimatedOpacity(
opacity: _ready ? 1 : 0,
duration: AppMotion.duration(context, 180),
child: ColoredBox(
color: Colors.black,
child: Video(
controller: _controller,
fit: BoxFit.cover,
controls: null,
pauseUponEnteringBackgroundMode: false,
resumeUponEnteringForegroundMode: false,
),
child: Video(
controller: _controller,
fit: BoxFit.cover,
fill: Colors.transparent,
controls: null,
pauseUponEnteringBackgroundMode: false,
resumeUponEnteringForegroundMode: false,
),
),
],