Skip to content

Commit

Permalink
feat: 未登录状态切换直播画质提示
Browse files Browse the repository at this point in the history
  • Loading branch information
guozhigq committed Mar 16, 2024
1 parent a37f3b8 commit 33d28f5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/pages/live_room/controller.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'package:pilipala/http/constants.dart';
import 'package:pilipala/http/live.dart';
Expand All @@ -21,6 +22,7 @@ class LiveRoomController extends GetxController {
Rx<RoomInfoH5Model> roomInfoH5 = RoomInfoH5Model().obs;
late bool enableCDN;
late int currentQn;
int? tempCurrentQn;
late List<Map<String, dynamic>> acceptQnList;
RxString currentQnDesc = ''.obs;

Expand Down Expand Up @@ -70,6 +72,9 @@ class LiveRoomController extends GetxController {
CodecItem item = codec.first;
// 以服务端返回的码率为准
currentQn = item.currentQn!;
if (tempCurrentQn != null && tempCurrentQn == currentQn) {
SmartDialog.showToast('画质切换失败,请检查登录状态');
}
List acceptQn = item.acceptQn!;
acceptQnList = acceptQn.map((e) {
return {
Expand Down Expand Up @@ -113,6 +118,7 @@ class LiveRoomController extends GetxController {

// 修改画质
void changeQn(int qn) async {
tempCurrentQn = currentQn;
if (currentQn == qn) {
return;
}
Expand Down

0 comments on commit 33d28f5

Please sign in to comment.