fix: 直播闪退 issues #540
This commit is contained in:
@ -3,7 +3,6 @@ import 'package:pilipala/http/constants.dart';
|
|||||||
import 'package:pilipala/http/live.dart';
|
import 'package:pilipala/http/live.dart';
|
||||||
import 'package:pilipala/models/live/room_info.dart';
|
import 'package:pilipala/models/live/room_info.dart';
|
||||||
import 'package:pilipala/plugin/pl_player/index.dart';
|
import 'package:pilipala/plugin/pl_player/index.dart';
|
||||||
|
|
||||||
import '../../models/live/room_info_h5.dart';
|
import '../../models/live/room_info_h5.dart';
|
||||||
|
|
||||||
class LiveRoomController extends GetxController {
|
class LiveRoomController extends GetxController {
|
||||||
@ -16,13 +15,6 @@ class LiveRoomController extends GetxController {
|
|||||||
RxBool volumeOff = false.obs;
|
RxBool volumeOff = false.obs;
|
||||||
PlPlayerController plPlayerController =
|
PlPlayerController plPlayerController =
|
||||||
PlPlayerController.getInstance(videoType: 'live');
|
PlPlayerController.getInstance(videoType: 'live');
|
||||||
|
|
||||||
// MeeduPlayerController meeduPlayerController = MeeduPlayerController(
|
|
||||||
// colorTheme: Theme.of(Get.context!).colorScheme.primary,
|
|
||||||
// pipEnabled: true,
|
|
||||||
// controlsStyle: ControlsStyle.live,
|
|
||||||
// enabledButtons: const EnabledButtons(pip: true),
|
|
||||||
// );
|
|
||||||
Rx<RoomInfoH5Model> roomInfoH5 = RoomInfoH5Model().obs;
|
Rx<RoomInfoH5Model> roomInfoH5 = RoomInfoH5Model().obs;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -39,8 +31,6 @@ class LiveRoomController extends GetxController {
|
|||||||
cover = liveItem.cover;
|
cover = liveItem.cover;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
queryLiveInfo();
|
|
||||||
queryLiveInfoH5();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
playerInit(source) async {
|
playerInit(source) async {
|
||||||
|
|||||||
@ -29,22 +29,18 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
plPlayerController = _liveRoomController.plPlayerController;
|
|
||||||
plPlayerController!.onPlayerStatusChanged.listen(
|
|
||||||
(PlayerStatus status) {
|
|
||||||
if (status == PlayerStatus.playing) {
|
|
||||||
isShowCover = false;
|
|
||||||
setState(() {});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
floating = Floating();
|
floating = Floating();
|
||||||
}
|
}
|
||||||
_futureBuilder = _liveRoomController.queryLiveInfoH5();
|
videoSourceInit();
|
||||||
_futureBuilderFuture = _liveRoomController.queryLiveInfo();
|
_futureBuilderFuture = _liveRoomController.queryLiveInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> videoSourceInit() async {
|
||||||
|
_futureBuilder = _liveRoomController.queryLiveInfoH5();
|
||||||
|
plPlayerController = _liveRoomController.plPlayerController;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
plPlayerController!.dispose();
|
plPlayerController!.dispose();
|
||||||
|
|||||||
Reference in New Issue
Block a user