feat: 播放器全屏回调

This commit is contained in:
guozhigq
2024-06-13 23:13:47 +08:00
parent 19864c0d78
commit 21542b729d
2 changed files with 13 additions and 1 deletions

View File

@ -514,6 +514,13 @@ class _VideoDetailPageState extends State<VideoDetailPage>
showEposideCb: () => vdCtr.videoType == SearchType.video
? videoIntroController.showEposideHandler()
: bangumiIntroController.showEposideHandler(),
fullScreenCb: (bool status) {
if (status) {
videoHeight.value = Get.size.height;
} else {
videoHeight.value = defaultVideoHeight;
}
},
),
);
},

View File

@ -39,6 +39,7 @@ class PLVideoPlayer extends StatefulWidget {
this.customWidget,
this.customWidgets,
this.showEposideCb,
this.fullScreenCb,
super.key,
});
@ -52,6 +53,7 @@ class PLVideoPlayer extends StatefulWidget {
final Widget? customWidget;
final List<Widget>? customWidgets;
final Function? showEposideCb;
final Function? fullScreenCb;
@override
State<PLVideoPlayer> createState() => _PLVideoPlayerState();
@ -335,7 +337,10 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
color: Colors.white,
),
),
fuc: () => _.triggerFullScreen(status: !_.isFullScreen.value),
fuc: () {
_.triggerFullScreen(status: !_.isFullScreen.value);
widget.fullScreenCb?.call(!_.isFullScreen.value);
},
),
};
final List<Widget> list = [];