mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-19 08:36:17 +08:00
opt live onlyPlayAudio
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -64,7 +64,7 @@ class LiveHttp {
|
||||
}
|
||||
}
|
||||
|
||||
static Future liveRoomInfo({roomId, qn}) async {
|
||||
static Future liveRoomInfo({roomId, qn, bool onlyAudio = false}) async {
|
||||
var res = await Request().get(
|
||||
Api.liveRoomInfo,
|
||||
queryParameters: {
|
||||
@@ -77,6 +77,7 @@ class LiveHttp {
|
||||
'ptype': 8,
|
||||
'dolby': 5,
|
||||
'panorama': 1,
|
||||
if (onlyAudio) 'only_audio': 1,
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
|
||||
@@ -93,7 +93,11 @@ class LiveRoomController extends GetxController {
|
||||
: Pref.liveQualityCellular;
|
||||
});
|
||||
}
|
||||
var res = await LiveHttp.liveRoomInfo(roomId: roomId, qn: currentQn);
|
||||
var res = await LiveHttp.liveRoomInfo(
|
||||
roomId: roomId,
|
||||
qn: currentQn,
|
||||
onlyAudio: plPlayerController.onlyPlayAudio.value,
|
||||
);
|
||||
if (res['status']) {
|
||||
RoomPlayInfoData data = res['data'];
|
||||
if (data.liveStatus != 1) {
|
||||
|
||||
@@ -171,6 +171,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
upName: roomInfoH5?.anchorInfo?.baseInfo?.uname,
|
||||
plPlayerController: plPlayerController,
|
||||
onSendDanmaku: onSendDanmaku,
|
||||
onPlayAudio: _liveRoomController.queryLiveInfo,
|
||||
),
|
||||
bottomControl: BottomControl(
|
||||
plPlayerController: plPlayerController,
|
||||
|
||||
@@ -10,17 +10,19 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart
|
||||
|
||||
class LiveHeaderControl extends StatelessWidget {
|
||||
const LiveHeaderControl({
|
||||
super.key,
|
||||
required this.title,
|
||||
required this.upName,
|
||||
required this.plPlayerController,
|
||||
required this.onSendDanmaku,
|
||||
super.key,
|
||||
required this.onPlayAudio,
|
||||
});
|
||||
|
||||
final String? title;
|
||||
final String? upName;
|
||||
final PlPlayerController plPlayerController;
|
||||
final VoidCallback onSendDanmaku;
|
||||
final VoidCallback onPlayAudio;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -95,7 +97,11 @@ class LiveHeaderControl extends StatelessWidget {
|
||||
width: 35,
|
||||
height: 35,
|
||||
child: IconButton(
|
||||
onPressed: plPlayerController.setOnlyPlayAudio,
|
||||
onPressed: () {
|
||||
plPlayerController.onlyPlayAudio.value =
|
||||
!plPlayerController.onlyPlayAudio.value;
|
||||
onPlayAudio();
|
||||
},
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user