diff --git a/lib/pages/live_room/widgets/bottom_control.dart b/lib/pages/live_room/widgets/bottom_control.dart index 66b34740..7447195e 100644 --- a/lib/pages/live_room/widgets/bottom_control.dart +++ b/lib/pages/live_room/widgets/bottom_control.dart @@ -44,7 +44,7 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget { size: 18, color: Colors.white, ), - fuc: onRefresh, + onTap: onRefresh, ), // // ComBtn( // icon: const Icon( @@ -192,7 +192,7 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget { size: 20, color: Colors.white, ), - fuc: () => plPlayerController.triggerFullScreen( + onTap: () => plPlayerController.triggerFullScreen( status: !plPlayerController.isFullScreen.value), ), ], diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index e0607acb..487ac7e6 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -303,7 +303,9 @@ class PlPlayerController { wordSpacing: 0.1, color: Colors.white, fontWeight: FontWeight.normal, - backgroundColor: Colors.black.withOpacity(subtitleBgOpaticy), + backgroundColor: subtitleBgOpaticy == 0 + ? null + : Colors.black.withOpacity(subtitleBgOpaticy), ); SubtitleViewConfiguration get subtitleViewConfiguration => diff --git a/lib/plugin/pl_player/view.dart b/lib/plugin/pl_player/view.dart index 9f480af8..7aa51417 100644 --- a/lib/plugin/pl_player/view.dart +++ b/lib/plugin/pl_player/view.dart @@ -274,7 +274,7 @@ class _PLVideoPlayerState extends State size: 22, color: Colors.white, ), - fuc: () { + onTap: () { bool? res; if (videoIntroController != null) { res = videoIntroController!.prevPlay(); @@ -306,7 +306,7 @@ class _PLVideoPlayerState extends State size: 22, color: Colors.white, ), - fuc: () { + onTap: () { bool? res; if (videoIntroController != null) { res = videoIntroController!.nextPlay(); @@ -385,7 +385,7 @@ class _PLVideoPlayerState extends State ), ], ), - fuc: () { + onTap: () { plPlayerController.showDmChart.value = !plPlayerController.showDmChart.value; }, @@ -448,7 +448,11 @@ class _PLVideoPlayerState extends State color: Colors.white, ), ), - fuc: widget.showViewPoints, + onTap: widget.showViewPoints, + onLongPress: () { + plPlayerController.showVP.value = + !plPlayerController.showVP.value; + }, ), ), ), @@ -465,7 +469,7 @@ class _PLVideoPlayerState extends State size: 22, color: Colors.white, ), - fuc: () { + onTap: () { int? index; int currentCid = plPlayerController.cid; String bvid = plPlayerController.bvid; @@ -629,7 +633,7 @@ class _PLVideoPlayerState extends State size: 24, color: Colors.white, ), - fuc: () => plPlayerController.triggerFullScreen( + onTap: () => plPlayerController.triggerFullScreen( status: !isFullScreen, duration: 800), ), ), @@ -1516,7 +1520,7 @@ class _PLVideoPlayerState extends State size: 15, color: Colors.white, ), - fuc: () => plPlayerController.onLockControl( + onTap: () => plPlayerController.onLockControl( !plPlayerController.controlsLock.value), ), ), @@ -1546,7 +1550,7 @@ class _PLVideoPlayerState extends State size: 20, color: Colors.white, ), - fuc: () { + onTap: () { SmartDialog.showToast('截图中'); plPlayerController.videoPlayerController ?.screenshot(format: 'image/png') diff --git a/lib/plugin/pl_player/widgets/common_btn.dart b/lib/plugin/pl_player/widgets/common_btn.dart index e9a3a0b8..0f32ad99 100644 --- a/lib/plugin/pl_player/widgets/common_btn.dart +++ b/lib/plugin/pl_player/widgets/common_btn.dart @@ -1,12 +1,14 @@ import 'package:flutter/material.dart'; class ComBtn extends StatelessWidget { - final Widget? icon; - final GestureTapCallback? fuc; + final Widget icon; + final VoidCallback? onTap; + final VoidCallback? onLongPress; const ComBtn({ - this.icon, - this.fuc, + required this.icon, + this.onTap, + this.onLongPress, super.key, }); @@ -16,8 +18,9 @@ class ComBtn extends StatelessWidget { width: 34, height: 34, child: GestureDetector( - onTap: fuc, - child: icon!, + onTap: onTap, + onLongPress: onLongPress, + child: icon, ), ); }