Skip to content

Commit

Permalink
revert: 暂时回退guozhigq关于直播的分支feature-liveRoomRender修改
Browse files Browse the repository at this point in the history
  • Loading branch information
orz12 committed Feb 14, 2024
1 parent 63481ab commit 251d098
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 328 deletions.
Binary file removed assets/images/live/default_bg.webp
Binary file not shown.
4 changes: 0 additions & 4 deletions lib/http/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,6 @@ class Api {
static const String liveRoomInfo =
'${HttpString.liveBaseUrl}/xlive/web-room/v2/index/getRoomPlayInfo';

// 直播间详情 H5
static const String liveRoomInfoH5 =
'${HttpString.liveBaseUrl}/xlive/web-room/v1/index/getH5InfoByRoom';

// 用户信息 需要Wbi签名
// https://api.bilibili.com/x/space/wbi/acc/info?mid=503427686&token=&platform=web&web_location=1550101&w_rid=d709892496ce93e3d94d6d37c95bde91&wts=1689301482
static const String memberInfo = '/x/space/wbi/acc/info';
Expand Down
19 changes: 0 additions & 19 deletions lib/http/live.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import '../models/live/item.dart';
import '../models/live/room_info.dart';
import '../models/live/room_info_h5.dart';
import 'api.dart';
import 'init.dart';

Expand Down Expand Up @@ -47,22 +46,4 @@ class LiveHttp {
};
}
}

static Future liveRoomInfoH5({roomId, qn}) async {
var res = await Request().get(Api.liveRoomInfoH5, data: {
'room_id': roomId,
});
if (res.data['code'] == 0) {
return {
'status': true,
'data': RoomInfoH5Model.fromJson(res.data['data'])
};
} else {
return {
'status': false,
'data': [],
'msg': res.data['message'],
};
}
}
}
21 changes: 12 additions & 9 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import 'package:pilipala/utils/recommend_filter.dart';
import 'package:catcher_2/catcher_2.dart';
import './services/loggeer.dart';


void main() async {
WidgetsFlutterBinding.ensureInitialized();
MediaKit.ensureInitialized();
Expand Down Expand Up @@ -77,15 +78,17 @@ void main() async {
},
);

// 小白条、导航栏沉浸
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
systemNavigationBarColor: Colors.transparent,
systemNavigationBarDividerColor: Colors.transparent,
statusBarColor: Colors.transparent,
));
Data.init();
PiliSchame.init();

// 小白条、导航栏沉浸
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
systemNavigationBarColor: Colors.transparent,
systemNavigationBarDividerColor: Colors.transparent,
statusBarColor: Colors.transparent,
));
Data.init();
GStrorage.lazyInit();
PiliSchame.init();
}

class MyApp extends StatelessWidget {
Expand Down
130 changes: 0 additions & 130 deletions lib/models/live/room_info_h5.dart

This file was deleted.

36 changes: 11 additions & 25 deletions lib/pages/live/widgets/live_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -159,32 +159,18 @@ class VideoStat extends StatelessWidget {
tileMode: TileMode.mirror,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
liveItem!.areaName!,
style: const TextStyle(fontSize: 11, color: Colors.white),
),
Text(
liveItem!.watchedShow!['text_small'],
style: const TextStyle(fontSize: 11, color: Colors.white),
),
],
child: RichText(
maxLines: 1,
textAlign: TextAlign.justify,
softWrap: false,
text: TextSpan(
style: const TextStyle(fontSize: 11, color: Colors.white),
children: [
TextSpan(text: liveItem!.areaName!),
TextSpan(text: liveItem!.watchedShow!['text_small']),
],
),
),

// child: RichText(
// maxLines: 1,
// textAlign: TextAlign.justify,
// softWrap: false,
// text: TextSpan(
// style: const TextStyle(fontSize: 11, color: Colors.white),
// children: [
// TextSpan(text: liveItem!.areaName!),
// TextSpan(text: liveItem!.watchedShow!['text_small']),
// ],
// ),
// ),
);
}
}
19 changes: 3 additions & 16 deletions lib/pages/live_room/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import 'package:pilipala/http/live.dart';
import 'package:pilipala/models/live/room_info.dart';
import 'package:pilipala/plugin/pl_player/index.dart';

import '../../models/live/room_info_h5.dart';

class LiveRoomController extends GetxController {
String cover = '';
late int roomId;
Expand All @@ -23,7 +21,6 @@ class LiveRoomController extends GetxController {
// controlsStyle: ControlsStyle.live,
// enabledButtons: const EnabledButtons(pip: true),
// );
Rx<RoomInfoH5Model> roomInfoH5 = RoomInfoH5Model().obs;

@override
void onInit() {
Expand All @@ -40,11 +37,10 @@ class LiveRoomController extends GetxController {
}
}
queryLiveInfo();
queryLiveInfoH5();
}

playerInit(source) async {
await plPlayerController.setDataSource(
playerInit(source) {
plPlayerController.setDataSource(
DataSource(
videoSource: source,
audioSource: null,
Expand All @@ -70,8 +66,7 @@ class LiveRoomController extends GetxController {
String videoUrl = (item.urlInfo?.first.host)! +
item.baseUrl! +
item.urlInfo!.first.extra!;
await playerInit(videoUrl);
return res;
playerInit(videoUrl);
}
}

Expand All @@ -85,12 +80,4 @@ class LiveRoomController extends GetxController {
volumeOff.value = true;
}
}

Future queryLiveInfoH5() async {
var res = await LiveHttp.liveRoomInfoH5(roomId: roomId);
if (res['status']) {
roomInfoH5.value = res['data'];
}
return res;
}
}
Loading

0 comments on commit 251d098

Please sign in to comment.