fix: 直播闪退 issues #540

This commit is contained in:
guozhigq
2024-02-14 19:38:55 +08:00
parent e2fd01a6d5
commit 3efad736ae
2 changed files with 6 additions and 20 deletions

View File

@ -29,22 +29,18 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
@override
void initState() {
super.initState();
plPlayerController = _liveRoomController.plPlayerController;
plPlayerController!.onPlayerStatusChanged.listen(
(PlayerStatus status) {
if (status == PlayerStatus.playing) {
isShowCover = false;
setState(() {});
}
},
);
if (Platform.isAndroid) {
floating = Floating();
}
_futureBuilder = _liveRoomController.queryLiveInfoH5();
videoSourceInit();
_futureBuilderFuture = _liveRoomController.queryLiveInfo();
}
Future<void> videoSourceInit() async {
_futureBuilder = _liveRoomController.queryLiveInfoH5();
plPlayerController = _liveRoomController.plPlayerController;
}
@override
void dispose() {
plPlayerController!.dispose();