Skip to content

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

fix windows desktop freeze when video playing

Predidit8d04974ebec3
diff --git a/lib/pages/video/video_page.dart b/lib/pages/video/video_page.dart
index 20f6ad0e..320c1159 100644
--- a/lib/pages/video/video_page.dart
+++ b/lib/pages/video/video_page.dart
@@ -152,7 +152,8 @@ class _VideoPageState extends State<VideoPage>
child: Stack(
children: [
Positioned.fill(
- child: (videoPageController.currentPlugin.useNativePlayer && playerController.loading)
+ child: (videoPageController.currentPlugin.useNativePlayer &&
+ playerController.loading)
? const Center(
child: CircularProgressIndicator(),
)
@@ -207,16 +208,24 @@ class _VideoPageState extends State<VideoPage>
? Container()
: const PlayerItem(),
),
+ /// workaround for webview_windows
+ /// The webview_windows component cannot be removed from the widget tree; otherwise, it can never be reinitialized.
+ /// The height of the webview_windows component cannot be set to 0; otherwise, it will intercept click events across the entire screen.
Positioned(
- child: SizedBox(
- height: (videoPageController.loading ||
- videoPageController.currentPlugin.useNativePlayer)
- ? 0
- : null,
- child: Platform.isWindows
- ? const WebviewDesktopItem()
- : const WebviewItem(),
- ))
+ child: Opacity(
+ opacity: (videoPageController.loading ||
+ videoPageController.currentPlugin.useNativePlayer)
+ ? 0.0
+ : 1.0,
+ child: SizedBox(
+ height: (videoPageController.loading ||
+ videoPageController.currentPlugin.useNativePlayer)
+ ? 1
+ : null,
+ child: Platform.isWindows
+ ? const WebviewDesktopItem()
+ : const WebviewItem(),
+ )))
],
);
}