Skip to content

Commit

Permalink
直播间支持查看播放信息
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyaocz committed Jun 6, 2024
1 parent de7eb47 commit a05951e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 25 deletions.
9 changes: 9 additions & 0 deletions simple_live_app/lib/modules/live_room/live_room_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,15 @@ class LiveRoomPage extends GetView<LiveRoomController> {
controller.openNaviteAPP();
},
),
ListTile(
leading: const Icon(Icons.info_outline_rounded),
title: const Text("播放信息"),
trailing: const Icon(Icons.chevron_right),
onTap: () {
Get.back();
controller.showDebugInfo();
},
),
],
),
),
Expand Down
36 changes: 22 additions & 14 deletions simple_live_app/lib/modules/live_room/player/player_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -699,24 +699,10 @@ class PlayerController extends BaseController
void mediaError(String error) {}

void showDebugInfo() {
if (lockControlsState.value && fullScreenState.value) {
return;
}
Utils.showBottomSheet(
title: "播放信息",
child: ListView(
children: [
ListTile(
title: const Text("Media"),
subtitle: Text(player.state.playlist.toString()),
onTap: () {
Clipboard.setData(
ClipboardData(
text: "Media\n${player.state.playlist}",
),
);
},
),
ListTile(
title: const Text("Resolution"),
subtitle: Text('${player.state.width}x${player.state.height}'),
Expand Down Expand Up @@ -751,6 +737,17 @@ class PlayerController extends BaseController
);
},
),
ListTile(
title: const Text("Media"),
subtitle: Text(player.state.playlist.toString()),
onTap: () {
Clipboard.setData(
ClipboardData(
text: "Media\n${player.state.playlist}",
),
);
},
),
ListTile(
title: const Text("AudioTrack"),
subtitle: Text(player.state.track.audio.toString()),
Expand Down Expand Up @@ -784,6 +781,17 @@ class PlayerController extends BaseController
);
},
),
ListTile(
title: const Text("Volume"),
subtitle: Text(player.state.volume.toString()),
onTap: () {
Clipboard.setData(
ClipboardData(
text: "Volume\n${player.state.volume}",
),
);
},
),
],
),
);
Expand Down
22 changes: 12 additions & 10 deletions simple_live_app/lib/modules/user/user_page.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
Expand Down Expand Up @@ -193,17 +194,18 @@ class UserPage extends StatelessWidget {
Get.toNamed(RoutePath.kSettingsOther);
},
),
ListTile(
leading: const Icon(Remix.apps_line),
title: const Text("测试"),
trailing: const Icon(
Icons.chevron_right,
color: Colors.grey,
if (kDebugMode)
ListTile(
leading: const Icon(Remix.apps_line),
title: const Text("测试"),
trailing: const Icon(
Icons.chevron_right,
color: Colors.grey,
),
onTap: () {
Get.toNamed(RoutePath.kTest);
},
),
onTap: () {
Get.toNamed(RoutePath.kTest);
},
),
],
),
Divider(
Expand Down
2 changes: 1 addition & 1 deletion simple_live_app/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: simple_live_app
version: 1.6.0+10600
version: 1.6.1+10601
publish_to: none
description: "Simple Live APP"
environment:
Expand Down

0 comments on commit a05951e

Please sign in to comment.