mod: 直播详情页样式修改
This commit is contained in:
@ -90,7 +90,7 @@ class LiveContent extends StatelessWidget {
|
||||
return Expanded(
|
||||
child: Padding(
|
||||
// 多列
|
||||
padding: const EdgeInsets.fromLTRB(8, 8, 6, 4),
|
||||
padding: const EdgeInsets.fromLTRB(8, 7, 6, 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
|
@ -10,11 +10,14 @@ class LiveRoomController extends GetxController {
|
||||
late int roomId;
|
||||
var liveItem;
|
||||
late String heroTag;
|
||||
double volume = 0.0;
|
||||
// 静音状态
|
||||
RxBool volumeOff = false.obs;
|
||||
|
||||
MeeduPlayerController meeduPlayerController = MeeduPlayerController(
|
||||
colorTheme: Theme.of(Get.context!).colorScheme.primary,
|
||||
pipEnabled: true,
|
||||
controlsStyle: ControlsStyle.youtube,
|
||||
controlsStyle: ControlsStyle.live,
|
||||
enabledButtons: const EnabledButtons(pip: true),
|
||||
);
|
||||
|
||||
@ -45,6 +48,7 @@ class LiveRoomController extends GetxController {
|
||||
),
|
||||
autoplay: true,
|
||||
);
|
||||
volume = meeduPlayerController.volume.value;
|
||||
}
|
||||
|
||||
Future queryLiveInfo() async {
|
||||
@ -59,4 +63,18 @@ class LiveRoomController extends GetxController {
|
||||
playerInit(videoUrl);
|
||||
}
|
||||
}
|
||||
|
||||
void setVolumn(value) {
|
||||
if (value == 0) {
|
||||
// 设置音量
|
||||
volumeOff.value = false;
|
||||
meeduPlayerController.setVolume(volume);
|
||||
} else {
|
||||
// 取消音量
|
||||
volume = value;
|
||||
volumeOff.value = true;
|
||||
meeduPlayerController.setVolume(0);
|
||||
}
|
||||
print('🌹:${volumeOff.value}');
|
||||
}
|
||||
}
|
||||
|
@ -69,13 +69,20 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
|
||||
_liveRoomController.liveItem.uname,
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
const SizedBox(height: 3),
|
||||
Text(_liveRoomController.liveItem.title,
|
||||
const SizedBox(height: 1),
|
||||
Text(_liveRoomController.liveItem.watchedShow['text_large'],
|
||||
style: const TextStyle(fontSize: 12)),
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
SizedBox(
|
||||
height: 34,
|
||||
child: ElevatedButton(onPressed: () {}, child: const Text('关注')),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
],
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
@ -86,6 +93,36 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
|
||||
AspectRatio(
|
||||
aspectRatio: 16 / 9,
|
||||
child: MeeduVideoPlayer(
|
||||
header: (BuildContext context,
|
||||
MeeduPlayerController _meeduPlayerController,
|
||||
Responsive) {
|
||||
return AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
primary: false,
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 0,
|
||||
foregroundColor: Colors.white,
|
||||
automaticallyImplyLeading: false,
|
||||
centerTitle: false,
|
||||
title: Text(_liveRoomController.liveItem.title,
|
||||
style: const TextStyle(fontSize: 12)),
|
||||
actions: [
|
||||
SizedBox(
|
||||
width: 38,
|
||||
height: 38,
|
||||
child: IconButton(
|
||||
onPressed: () =>
|
||||
_meeduPlayerController.enterPip(context),
|
||||
icon: const Icon(
|
||||
Icons.branding_watermark_outlined,
|
||||
size: 19,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12)
|
||||
],
|
||||
);
|
||||
},
|
||||
controller: _meeduPlayerController!,
|
||||
),
|
||||
),
|
||||
@ -110,9 +147,6 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
|
||||
Container(
|
||||
height: 45,
|
||||
padding: const EdgeInsets.only(left: 12, right: 12),
|
||||
child: Row(children: [
|
||||
Text(_liveRoomController.liveItem.watchedShow['text_large']),
|
||||
]),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
border: Border(
|
||||
@ -120,6 +154,56 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
|
||||
color: Theme.of(context).dividerColor.withOpacity(0.1)),
|
||||
),
|
||||
),
|
||||
child: Row(children: <Widget>[
|
||||
// SizedBox(
|
||||
// width: 38,
|
||||
// height: 38,
|
||||
// child: IconButton(
|
||||
// onPressed: () {},
|
||||
// icon: const Icon(
|
||||
// Icons.subtitles_outlined,
|
||||
// size: 21,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
const Spacer(),
|
||||
// SizedBox(
|
||||
// width: 38,
|
||||
// height: 38,
|
||||
// child: IconButton(
|
||||
// onPressed: () {},
|
||||
// icon: const Icon(
|
||||
// Icons.hd_outlined,
|
||||
// size: 20,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
SizedBox(
|
||||
width: 38,
|
||||
height: 38,
|
||||
child: IconButton(
|
||||
onPressed: () => _liveRoomController
|
||||
.setVolumn(_meeduPlayerController!.volume.value),
|
||||
icon: Obx(() => Icon(
|
||||
_liveRoomController.volumeOff.value
|
||||
? Icons.volume_off_outlined
|
||||
: Icons.volume_up_outlined,
|
||||
size: 21,
|
||||
)),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 38,
|
||||
height: 38,
|
||||
child: IconButton(
|
||||
onPressed: () =>
|
||||
_meeduPlayerController!.goToFullscreen(context),
|
||||
icon: const Icon(
|
||||
Icons.fullscreen,
|
||||
),
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -424,7 +424,7 @@ packages:
|
||||
description:
|
||||
path: package
|
||||
ref: feature-custom
|
||||
resolved-ref: ea73de29401ab35126ef3eac68270b2e6c3ef4e0
|
||||
resolved-ref: "3b879c2ea736ade61236f82d5009230e054db5dd"
|
||||
url: "https://github.com/guozhigq/flutter_meedu_media_kit.git"
|
||||
source: git
|
||||
version: "4.2.12"
|
||||
|
Reference in New Issue
Block a user