feat: 快进、快退、拖动时时间戳展示、关闭自动播放时处理、单p播放完成处理

This commit is contained in:
guozhigq
2023-08-01 22:51:33 +08:00
parent b947397333
commit e97abb545f
9 changed files with 585 additions and 40 deletions

View File

@ -55,7 +55,11 @@ class _VideoDetailPageState extends State<VideoDetailPage>
isPlay = true;
setState(() {});
// 播放完成停止 or 切换下一个
if (status == PlayerStatus.completed) {}
if (status == PlayerStatus.completed) {
// 当只有1p或多p未打开自动播放时播放完成还原进度条展示控制栏
plPlayerController!.seekTo(Duration.zero);
plPlayerController!.onLockControl(false);
}
}
},
);
@ -180,6 +184,38 @@ class _VideoDetailPageState extends State<VideoDetailPage>
),
),
),
/// 关闭自动播放时 手动播放
Obx(
() => Visibility(
visible: isShowCover &&
videoDetailController
.isEffective.value &&
!videoDetailController.autoPlay.value,
child: Positioned(
right: 12,
bottom: 6,
child: TextButton.icon(
style: ButtonStyle(
backgroundColor:
MaterialStateProperty
.resolveWith((states) {
return Theme.of(context)
.colorScheme
.primaryContainer;
}),
),
onPressed: () => videoDetailController
.handlePlay(),
icon: const Icon(
Icons.play_circle_outline,
size: 20,
),
label: const Text('Play'),
),
),
),
),
],
),
);