feat: 同时在看人数

This commit is contained in:
guozhigq
2023-08-24 08:38:01 +08:00
parent b67127123a
commit 201422c150
7 changed files with 81 additions and 0 deletions

View File

@ -37,6 +37,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
PlPlayerController? plPlayerController;
final ScrollController _extendNestCtr = ScrollController();
late StreamController<double> appbarStream;
final VideoIntroController videoIntroController =
Get.put(VideoIntroController(), tag: Get.arguments['heroTag']);
PlayerStatus playerStatus = PlayerStatus.playing;
// bool isShowCover = true;
@ -104,6 +106,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
// 离开当前页面时
void didPushNext() async {
videoDetailController.defaultST = plPlayerController!.position.value;
videoIntroController.isPaused = true;
plPlayerController!.pause();
super.didPushNext();
}
@ -112,6 +115,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
// 返回当前页面时
void didPopNext() async {
videoDetailController.playerInit();
videoIntroController.isPaused = false;
if (_extendNestCtr.position.pixels == 0) {
await Future.delayed(const Duration(milliseconds: 300));
plPlayerController!.play();