mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-14 13:20:17 +08:00
@@ -36,6 +36,7 @@ import 'package:PiliPlus/utils/extension/num_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/size_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/theme_ext.dart';
|
||||
import 'package:PiliPlus/utils/image_utils.dart';
|
||||
import 'package:PiliPlus/utils/mobile_observer.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:PiliPlus/utils/platform_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
@@ -72,7 +73,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
addObserverMobile(this);
|
||||
_liveRoomController = Get.put(
|
||||
LiveRoomController(heroTag),
|
||||
tag: heroTag,
|
||||
@@ -94,7 +95,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
|
||||
@override
|
||||
Future<void> didPopNext() async {
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
addObserverMobile(this);
|
||||
plPlayerController
|
||||
..isLive = true
|
||||
..danmakuController = _liveRoomController.danmakuController;
|
||||
@@ -121,7 +122,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
|
||||
@override
|
||||
void didPushNext() {
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
removeObserverMobile(this);
|
||||
plPlayerController.removeStatusLister(playerListener);
|
||||
_liveRoomController
|
||||
..danmakuController?.clear()
|
||||
@@ -148,8 +149,8 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
removeObserverMobile(this);
|
||||
videoPlayerServiceHandler?.onVideoDetailDispose(heroTag);
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
if (Platform.isAndroid && !plPlayerController.setSystemBrightness) {
|
||||
ScreenBrightnessPlatform.instance.resetApplicationScreenBrightness();
|
||||
}
|
||||
|
||||
@@ -196,26 +196,27 @@ class _LiveHeaderControlState extends State<LiveHeaderControl>
|
||||
);
|
||||
},
|
||||
),
|
||||
Obx(() {
|
||||
final continuePlayInBackground =
|
||||
plPlayerController.continuePlayInBackground.value;
|
||||
return ComBtn(
|
||||
height: 30,
|
||||
tooltip: '${continuePlayInBackground ? '关闭' : ''}后台播放',
|
||||
onTap: plPlayerController.setContinuePlayInBackground,
|
||||
icon: continuePlayInBackground
|
||||
? const Icon(
|
||||
size: 18,
|
||||
Icons.play_circle,
|
||||
color: Colors.white,
|
||||
)
|
||||
: const Icon(
|
||||
size: 18,
|
||||
Icons.play_circle_outline,
|
||||
color: Colors.white,
|
||||
),
|
||||
);
|
||||
}),
|
||||
if (PlatformUtils.isMobile)
|
||||
Obx(() {
|
||||
final continuePlayInBackground =
|
||||
plPlayerController.continuePlayInBackground.value;
|
||||
return ComBtn(
|
||||
height: 30,
|
||||
tooltip: '${continuePlayInBackground ? '关闭' : ''}后台播放',
|
||||
onTap: plPlayerController.setContinuePlayInBackground,
|
||||
icon: continuePlayInBackground
|
||||
? const Icon(
|
||||
size: 18,
|
||||
Icons.play_circle,
|
||||
color: Colors.white,
|
||||
)
|
||||
: const Icon(
|
||||
size: 18,
|
||||
Icons.play_circle_outline,
|
||||
color: Colors.white,
|
||||
),
|
||||
);
|
||||
}),
|
||||
ComBtn(
|
||||
height: 30,
|
||||
tooltip: '定时关闭',
|
||||
|
||||
Reference in New Issue
Block a user