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

@ -50,6 +50,10 @@ class VideoDetailController extends GetxController
Box user = GStrorage.user;
Box localCache = GStrorage.localCache;
PlPlayerController plPlayerController = PlPlayerController();
// 是否开始自动播放 存在多p的情况下第二p需要为true
RxBool autoPlay = true.obs;
// 视频资源是否有效
RxBool isEffective = true.obs;
@override
void onInit() {
@ -130,12 +134,17 @@ class VideoDetailController extends GetxController
),
// 硬解
enableHA: true,
autoplay: true,
autoplay: autoPlay.value,
seekTo: defaultST,
duration: Duration(milliseconds: duration),
);
}
// 手动点击播放
handlePlay() {
plPlayerController.togglePlay();
}
// 视频链接
queryVideoUrl() async {
var result = await VideoHttp.videoUrl(cid: cid, bvid: bvid);