修复直播全屏异常

This commit is contained in:
orz12
2023-12-29 20:08:51 +08:00
committed by GitHub
parent 3039503726
commit 258d356a00

View File

@ -54,7 +54,11 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
Widget childWhenDisabled = Scaffold( Widget childWhenDisabled = Scaffold(
primary: true, primary: true,
appBar: AppBar( appBar: PreferredSize(
preferredSize: Size.fromHeight(
MediaQuery.of(context).orientation == Orientation.portrait ? 56 : 0,
),
child: AppBar(
centerTitle: false, centerTitle: false,
titleSpacing: 0, titleSpacing: 0,
title: _liveRoomController.liveItem != null title: _liveRoomController.liveItem != null
@ -94,12 +98,28 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
// const SizedBox(width: 12), // const SizedBox(width: 12),
// ], // ],
), ),
),
body: Column( body: Column(
children: [ children: [
Stack( Stack(
children: [ children: [
AspectRatio( PopScope(
aspectRatio: 16 / 9, canPop: plPlayerController?.isFullScreen.value != true,
onPopInvoked: (bool didPop) {
if (plPlayerController?.isFullScreen.value == true) {
plPlayerController!.triggerFullScreen(status: false);
}
if (MediaQuery.of(context).orientation ==
Orientation.landscape) {
verticalScreen();
}
},
child: SizedBox(
width: Get.size.width,
height: MediaQuery.of(context).orientation ==
Orientation.landscape
? Get.size.height
: Get.size.width * 9 / 16,
child: plPlayerController!.videoPlayerController != null child: plPlayerController!.videoPlayerController != null
? PLVideoPlayer( ? PLVideoPlayer(
controller: plPlayerController!, controller: plPlayerController!,
@ -111,6 +131,7 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
) )
: const SizedBox(), : const SizedBox(),
), ),
),
// if (_liveRoomController.liveItem != null && // if (_liveRoomController.liveItem != null &&
// _liveRoomController.liveItem.cover != null) // _liveRoomController.liveItem.cover != null)
// Visibility( // Visibility(