mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-24 11:06:51 +08:00
opt live room
tweak Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -91,26 +91,7 @@ class LiveRoomController extends GetxController {
|
||||
if (res['status']) {
|
||||
RoomPlayInfoData data = res['data'];
|
||||
if (data.liveStatus != 1) {
|
||||
Get.dialog(
|
||||
AlertDialog(
|
||||
title: const Text('当前直播间未开播'),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: Get.back,
|
||||
child: Text(
|
||||
'关闭',
|
||||
style: TextStyle(color: Get.theme.colorScheme.outline),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Get
|
||||
..back()
|
||||
..back(),
|
||||
child: const Text('退出'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
_dialog(title: '当前直播间未开播');
|
||||
return;
|
||||
}
|
||||
isPortrait.value = data.isPortrait ?? false;
|
||||
@@ -145,9 +126,38 @@ class LiveRoomController extends GetxController {
|
||||
roomId,
|
||||
heroTag,
|
||||
);
|
||||
} else {
|
||||
if (res['msg'] != null) {
|
||||
_dialog(title: res['msg']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void _dialog({
|
||||
required String title,
|
||||
}) {
|
||||
Get.dialog(
|
||||
AlertDialog(
|
||||
title: Text(title),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: Get.back,
|
||||
child: Text(
|
||||
'关闭',
|
||||
style: TextStyle(color: Get.theme.colorScheme.outline),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Get
|
||||
..back()
|
||||
..back(),
|
||||
child: const Text('退出'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
LiveMessageStream? msgStream;
|
||||
final ScrollController scrollController = ScrollController();
|
||||
|
||||
|
||||
@@ -370,36 +370,38 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
RoomInfoH5Data? roomInfoH5 = _liveRoomController.roomInfoH5.value;
|
||||
return roomInfoH5 == null
|
||||
? const SizedBox.shrink()
|
||||
: Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () => Get.toNamed(
|
||||
'/member?mid=${roomInfoH5.roomInfo?.uid}'),
|
||||
child: NetworkImgLayer(
|
||||
: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () =>
|
||||
Get.toNamed('/member?mid=${roomInfoH5.roomInfo?.uid}'),
|
||||
child: Row(
|
||||
spacing: 10,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
NetworkImgLayer(
|
||||
width: 34,
|
||||
height: 34,
|
||||
type: ImageType.avatar,
|
||||
src: roomInfoH5.anchorInfo!.baseInfo!.face,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
roomInfoH5.anchorInfo!.baseInfo!.uname!,
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
const SizedBox(height: 1),
|
||||
if (roomInfoH5.watchedShow?.textLarge?.isNotEmpty ==
|
||||
true)
|
||||
Column(
|
||||
spacing: 1,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
roomInfoH5.watchedShow!.textLarge!,
|
||||
style: const TextStyle(fontSize: 12),
|
||||
roomInfoH5.anchorInfo!.baseInfo!.uname!,
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
if (roomInfoH5.watchedShow?.textLarge?.isNotEmpty ==
|
||||
true)
|
||||
Text(
|
||||
roomInfoH5.watchedShow!.textLarge!,
|
||||
style: const TextStyle(fontSize: 12),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -47,19 +47,26 @@ class BottomControl extends StatelessWidget {
|
||||
),
|
||||
const Spacer(),
|
||||
Obx(
|
||||
() => IconButton(
|
||||
onPressed: () {
|
||||
plPlayerController.isOpenDanmu.value =
|
||||
!plPlayerController.isOpenDanmu.value;
|
||||
GStorage.setting.put(SettingBoxKey.enableShowDanmaku,
|
||||
plPlayerController.isOpenDanmu.value);
|
||||
},
|
||||
icon: Icon(
|
||||
size: 18,
|
||||
plPlayerController.isOpenDanmu.value
|
||||
? Icons.subtitles_outlined
|
||||
: Icons.subtitles_off_outlined,
|
||||
color: Colors.white,
|
||||
() => SizedBox(
|
||||
width: 35,
|
||||
height: 35,
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () {
|
||||
plPlayerController.isOpenDanmu.value =
|
||||
!plPlayerController.isOpenDanmu.value;
|
||||
GStorage.setting.put(SettingBoxKey.enableShowDanmaku,
|
||||
plPlayerController.isOpenDanmu.value);
|
||||
},
|
||||
icon: Icon(
|
||||
size: 18,
|
||||
plPlayerController.isOpenDanmu.value
|
||||
? Icons.subtitles_outlined
|
||||
: Icons.subtitles_off_outlined,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -30,6 +30,7 @@ class LiveHeaderControl extends StatelessWidget {
|
||||
automaticallyImplyLeading: false,
|
||||
titleSpacing: 14,
|
||||
title: Row(
|
||||
spacing: 10,
|
||||
children: [
|
||||
if (title != null)
|
||||
Expanded(
|
||||
@@ -55,72 +56,92 @@ class LiveHeaderControl extends StatelessWidget {
|
||||
)
|
||||
else
|
||||
const Spacer(),
|
||||
IconButton(
|
||||
tooltip: '发弹幕',
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: onSendDanmaku,
|
||||
icon: const Icon(
|
||||
Icons.comment_outlined,
|
||||
size: 18,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => IconButton(
|
||||
onPressed: plPlayerController.setOnlyPlayAudio,
|
||||
icon: plPlayerController.onlyPlayAudio.value
|
||||
? const Icon(
|
||||
size: 18,
|
||||
MdiIcons.musicCircle,
|
||||
color: Colors.white,
|
||||
)
|
||||
: const Icon(
|
||||
size: 18,
|
||||
MdiIcons.musicCircleOutline,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
if (Platform.isAndroid) ...[
|
||||
IconButton(
|
||||
tooltip: '画中画',
|
||||
SizedBox(
|
||||
width: 35,
|
||||
height: 35,
|
||||
child: IconButton(
|
||||
tooltip: '发弹幕',
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () async {
|
||||
try {
|
||||
var floating = Floating();
|
||||
if ((await floating.isPipAvailable) == true) {
|
||||
plPlayerController.hiddenControls(false);
|
||||
floating.enable(
|
||||
plPlayerController.direction.value == 'vertical'
|
||||
? const EnableManual(aspectRatio: Rational.vertical())
|
||||
: const EnableManual(),
|
||||
);
|
||||
}
|
||||
} catch (_) {}
|
||||
},
|
||||
onPressed: onSendDanmaku,
|
||||
icon: const Icon(
|
||||
Icons.picture_in_picture_outlined,
|
||||
Icons.comment_outlined,
|
||||
size: 18,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
],
|
||||
IconButton(
|
||||
onPressed: () => PageUtils.scheduleExit(
|
||||
context,
|
||||
plPlayerController.isFullScreen.value,
|
||||
true,
|
||||
),
|
||||
Obx(
|
||||
() => SizedBox(
|
||||
width: 35,
|
||||
height: 35,
|
||||
child: IconButton(
|
||||
onPressed: plPlayerController.setOnlyPlayAudio,
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
icon: plPlayerController.onlyPlayAudio.value
|
||||
? const Icon(
|
||||
size: 18,
|
||||
MdiIcons.musicCircle,
|
||||
color: Colors.white,
|
||||
)
|
||||
: const Icon(
|
||||
size: 18,
|
||||
MdiIcons.musicCircleOutline,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
icon: const Icon(
|
||||
size: 18,
|
||||
Icons.schedule,
|
||||
color: Colors.white,
|
||||
),
|
||||
if (Platform.isAndroid)
|
||||
SizedBox(
|
||||
width: 35,
|
||||
height: 35,
|
||||
child: IconButton(
|
||||
tooltip: '画中画',
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () async {
|
||||
try {
|
||||
var floating = Floating();
|
||||
if ((await floating.isPipAvailable) == true) {
|
||||
plPlayerController.hiddenControls(false);
|
||||
floating.enable(
|
||||
plPlayerController.direction.value == 'vertical'
|
||||
? const EnableManual(
|
||||
aspectRatio: Rational.vertical())
|
||||
: const EnableManual(),
|
||||
);
|
||||
}
|
||||
} catch (_) {}
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.picture_in_picture_outlined,
|
||||
size: 18,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 35,
|
||||
height: 35,
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () => PageUtils.scheduleExit(
|
||||
context,
|
||||
plPlayerController.isFullScreen.value,
|
||||
true,
|
||||
),
|
||||
icon: const Icon(
|
||||
size: 18,
|
||||
Icons.schedule,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user