feat: 播放器全屏回调

This commit is contained in:
guozhigq
2024-06-13 23:13:47 +08:00
parent 5afb50cac9
commit 2873754317
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 showEposideCb: () => vdCtr.videoType == SearchType.video
? videoIntroController.showEposideHandler() ? videoIntroController.showEposideHandler()
: bangumiIntroController.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.customWidget,
this.customWidgets, this.customWidgets,
this.showEposideCb, this.showEposideCb,
this.fullScreenCb,
super.key, super.key,
}); });
@ -52,6 +53,7 @@ class PLVideoPlayer extends StatefulWidget {
final Widget? customWidget; final Widget? customWidget;
final List<Widget>? customWidgets; final List<Widget>? customWidgets;
final Function? showEposideCb; final Function? showEposideCb;
final Function? fullScreenCb;
@override @override
State<PLVideoPlayer> createState() => _PLVideoPlayerState(); State<PLVideoPlayer> createState() => _PLVideoPlayerState();
@ -335,7 +337,10 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
color: Colors.white, color: Colors.white,
), ),
), ),
fuc: () => _.triggerFullScreen(status: !_.isFullScreen.value), fuc: () {
_.triggerFullScreen(status: !_.isFullScreen.value);
widget.fullScreenCb?.call(!_.isFullScreen.value);
},
), ),
}; };
final List<Widget> list = []; final List<Widget> list = [];