mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-30 23:58:13 +08:00
opt video action
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1010,6 +1010,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
);
|
);
|
||||||
|
final isLive = plPlayerController.isLive;
|
||||||
|
|
||||||
return Stack(
|
return Stack(
|
||||||
fit: StackFit.passthrough,
|
fit: StackFit.passthrough,
|
||||||
@@ -1028,8 +1029,9 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
!plPlayerController.continuePlayInBackground.value,
|
!plPlayerController.continuePlayInBackground.value,
|
||||||
resumeUponEnteringForegroundMode: true,
|
resumeUponEnteringForegroundMode: true,
|
||||||
// 字幕尺寸调节
|
// 字幕尺寸调节
|
||||||
subtitleViewConfiguration:
|
subtitleViewConfiguration: isLive
|
||||||
plPlayerController.subtitleConfig.value,
|
? const SubtitleViewConfiguration()
|
||||||
|
: plPlayerController.subtitleConfig.value,
|
||||||
fit: videoFit.boxFit,
|
fit: videoFit.boxFit,
|
||||||
aspectRatio: videoFit.aspectRatio,
|
aspectRatio: videoFit.aspectRatio,
|
||||||
dmWidget: widget.danmuWidget,
|
dmWidget: widget.danmuWidget,
|
||||||
@@ -1047,10 +1049,12 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
onTap: () => plPlayerController.controls =
|
onTap: () => plPlayerController.controls =
|
||||||
!plPlayerController.showControls.value,
|
!plPlayerController.showControls.value,
|
||||||
onDoubleTapDown: onDoubleTapDown,
|
onDoubleTapDown: onDoubleTapDown,
|
||||||
onLongPressStart: (_) =>
|
onLongPressStart: isLive
|
||||||
plPlayerController.setLongPressStatus(true),
|
? null
|
||||||
onLongPressEnd: (_) =>
|
: (_) => plPlayerController.setLongPressStatus(true),
|
||||||
plPlayerController.setLongPressStatus(false),
|
onLongPressEnd: isLive
|
||||||
|
? null
|
||||||
|
: (_) => plPlayerController.setLongPressStatus(false),
|
||||||
enableDragSubtitle: plPlayerController.enableDragSubtitle,
|
enableDragSubtitle: plPlayerController.enableDragSubtitle,
|
||||||
onUpdatePadding: plPlayerController.onUpdatePadding,
|
onUpdatePadding: plPlayerController.onUpdatePadding,
|
||||||
);
|
);
|
||||||
@@ -1062,6 +1066,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
// Positioned.fill(top: 4, child: widget.danmuWidget!),
|
// Positioned.fill(top: 4, child: widget.danmuWidget!),
|
||||||
|
|
||||||
/// 长按倍速 toast
|
/// 长按倍速 toast
|
||||||
|
if (!isLive)
|
||||||
IgnorePointer(
|
IgnorePointer(
|
||||||
ignoring: true,
|
ignoring: true,
|
||||||
child: Align(
|
child: Align(
|
||||||
@@ -1073,7 +1078,9 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
child: Obx(
|
child: Obx(
|
||||||
() => AnimatedOpacity(
|
() => AnimatedOpacity(
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOut,
|
||||||
opacity: plPlayerController.longPressStatus.value ? 1.0 : 0.0,
|
opacity: plPlayerController.longPressStatus.value
|
||||||
|
? 1.0
|
||||||
|
: 0.0,
|
||||||
duration: const Duration(milliseconds: 150),
|
duration: const Duration(milliseconds: 150),
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(6),
|
padding: const EdgeInsets.all(6),
|
||||||
@@ -1098,6 +1105,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
),
|
),
|
||||||
|
|
||||||
/// 时间进度 toast
|
/// 时间进度 toast
|
||||||
|
if (!isLive)
|
||||||
IgnorePointer(
|
IgnorePointer(
|
||||||
ignoring: true,
|
ignoring: true,
|
||||||
child: Align(
|
child: Align(
|
||||||
@@ -1109,7 +1117,9 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
child: Obx(
|
child: Obx(
|
||||||
() => AnimatedOpacity(
|
() => AnimatedOpacity(
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOut,
|
||||||
opacity: plPlayerController.isSliderMoving.value ? 1.0 : 0.0,
|
opacity: plPlayerController.isSliderMoving.value
|
||||||
|
? 1.0
|
||||||
|
: 0.0,
|
||||||
duration: const Duration(milliseconds: 150),
|
duration: const Duration(milliseconds: 150),
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
@@ -1350,7 +1360,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
),
|
),
|
||||||
|
|
||||||
/// 进度条 live模式下禁用
|
/// 进度条 live模式下禁用
|
||||||
if (!plPlayerController.isLive &&
|
if (!isLive &&
|
||||||
plPlayerController.progressType != BtmProgressBehavior.alwaysHide)
|
plPlayerController.progressType != BtmProgressBehavior.alwaysHide)
|
||||||
Positioned(
|
Positioned(
|
||||||
bottom: -2.2,
|
bottom: -2.2,
|
||||||
@@ -1453,7 +1463,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
if (!plPlayerController.isLive && plPlayerController.showSeekPreview)
|
if (!isLive && plPlayerController.showSeekPreview)
|
||||||
buildSeekPreviewWidget(
|
buildSeekPreviewWidget(
|
||||||
plPlayerController,
|
plPlayerController,
|
||||||
maxWidth,
|
maxWidth,
|
||||||
@@ -1461,10 +1471,11 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
),
|
),
|
||||||
|
|
||||||
// 锁
|
// 锁
|
||||||
|
if (!isLive)
|
||||||
SafeArea(
|
SafeArea(
|
||||||
child: Obx(
|
child: Obx(
|
||||||
() => Visibility(
|
() => Visibility(
|
||||||
visible: !plPlayerController.isLive && isFullScreen,
|
visible: isFullScreen,
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: FractionalTranslation(
|
child: FractionalTranslation(
|
||||||
@@ -1472,7 +1483,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
child: Visibility(
|
child: Visibility(
|
||||||
visible:
|
visible:
|
||||||
plPlayerController.showControls.value &&
|
plPlayerController.showControls.value &&
|
||||||
(isFullScreen || plPlayerController.controlsLock.value),
|
(isFullScreen ||
|
||||||
|
plPlayerController.controlsLock.value),
|
||||||
child: DecoratedBox(
|
child: DecoratedBox(
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: Color(0x45000000),
|
color: Color(0x45000000),
|
||||||
@@ -1647,8 +1659,10 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
/// 点击 快进/快退
|
/// 点击 快进/快退
|
||||||
|
if (!isLive)
|
||||||
Obx(
|
Obx(
|
||||||
() => _mountSeekBackwardButton.value || _mountSeekForwardButton.value
|
() =>
|
||||||
|
_mountSeekBackwardButton.value || _mountSeekForwardButton.value
|
||||||
? Positioned.fill(
|
? Positioned.fill(
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
@@ -1669,7 +1683,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
final Player player = widget
|
final Player player = widget
|
||||||
.plPlayerController
|
.plPlayerController
|
||||||
.videoPlayerController!;
|
.videoPlayerController!;
|
||||||
Duration result = player.state.position - value;
|
Duration result =
|
||||||
|
player.state.position - value;
|
||||||
result = result.clamp(
|
result = result.clamp(
|
||||||
Duration.zero,
|
Duration.zero,
|
||||||
player.state.duration,
|
player.state.duration,
|
||||||
@@ -1699,7 +1714,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
final Player player = widget
|
final Player player = widget
|
||||||
.plPlayerController
|
.plPlayerController
|
||||||
.videoPlayerController!;
|
.videoPlayerController!;
|
||||||
Duration result = player.state.position + value;
|
Duration result =
|
||||||
|
player.state.position + value;
|
||||||
result = result.clamp(
|
result = result.clamp(
|
||||||
Duration.zero,
|
Duration.zero,
|
||||||
player.state.duration,
|
player.state.duration,
|
||||||
|
|||||||
Reference in New Issue
Block a user