opt live room

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-05-09 14:33:44 +08:00
parent bbdcc1d3ce
commit e8ece0ed3d

View File

@@ -99,9 +99,12 @@ class _LiveRoomPageState extends State<LiveRoomPage>
@override @override
Future<void> didPopNext() async { Future<void> didPopNext() async {
addObserverMobile(this); addObserverMobile(this);
plPlayerController if (!plPlayerController.isLive) {
..isLive = true plPlayerController.isLive = true;
..danmakuController = _liveRoomController.danmakuController; _liveRoomController.isLoaded.refresh();
}
plPlayerController.danmakuController =
_liveRoomController.danmakuController;
PlPlayerController.setPlayCallBack(plPlayerController.play); PlPlayerController.setPlayCallBack(plPlayerController.play);
_liveRoomController.startLiveTimer(); _liveRoomController.startLiveTimer();
if (plPlayerController.playerStatus.isPlaying && if (plPlayerController.playerStatus.isPlaying &&
@@ -221,9 +224,6 @@ class _LiveRoomPageState extends State<LiveRoomPage>
Alignment alignment = Alignment.center, Alignment alignment = Alignment.center,
bool needDm = true, bool needDm = true,
}) { }) {
if (!plPlayerController.isLive) {
return const SizedBox.shrink();
}
if (!isFullScreen && !plPlayerController.isDesktopPip) { if (!isFullScreen && !plPlayerController.isDesktopPip) {
_liveRoomController.fsSC.value = null; _liveRoomController.fsSC.value = null;
} }
@@ -231,7 +231,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
Widget player = Obx( Widget player = Obx(
key: playerKey, key: playerKey,
() { () {
if (_liveRoomController.isLoaded.value) { if (_liveRoomController.isLoaded.value && plPlayerController.isLive) {
final roomInfoH5 = _liveRoomController.roomInfoH5.value; final roomInfoH5 = _liveRoomController.roomInfoH5.value;
return PLVideoPlayer( return PLVideoPlayer(
maxWidth: width, maxWidth: width,