merge design
This commit is contained in:
@ -106,6 +106,7 @@ class PlPlayerController {
|
||||
];
|
||||
|
||||
PreferredSizeWidget? headerControl;
|
||||
PreferredSizeWidget? bottomControl;
|
||||
Widget? danmuWidget;
|
||||
|
||||
/// 数据加载监听
|
||||
@ -828,6 +829,7 @@ class PlPlayerController {
|
||||
child: PLVideoPlayer(
|
||||
controller: this,
|
||||
headerControl: headerControl,
|
||||
bottomControl: bottomControl,
|
||||
danmuWidget: danmuWidget,
|
||||
),
|
||||
),
|
||||
@ -879,6 +881,9 @@ class PlPlayerController {
|
||||
if (!_enableHeart) {
|
||||
return false;
|
||||
}
|
||||
if (videoType.value == 'live') {
|
||||
return;
|
||||
}
|
||||
// 播放状态变化时,更新
|
||||
if (type == 'status') {
|
||||
await VideoHttp.heartBeat(
|
||||
|
||||
@ -29,11 +29,13 @@ import 'widgets/forward_seek.dart';
|
||||
class PLVideoPlayer extends StatefulWidget {
|
||||
final PlPlayerController controller;
|
||||
final PreferredSizeWidget? headerControl;
|
||||
final PreferredSizeWidget? bottomControl;
|
||||
final Widget? danmuWidget;
|
||||
|
||||
const PLVideoPlayer({
|
||||
required this.controller,
|
||||
this.headerControl,
|
||||
this.bottomControl,
|
||||
this.danmuWidget,
|
||||
super.key,
|
||||
});
|
||||
@ -120,6 +122,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
vsync: this, duration: const Duration(milliseconds: 300));
|
||||
videoController = widget.controller.videoController!;
|
||||
widget.controller.headerControl = widget.headerControl;
|
||||
widget.controller.bottomControl = widget.bottomControl;
|
||||
widget.controller.danmuWidget = widget.danmuWidget;
|
||||
defaultBtmProgressBehavior = setting.get(SettingBoxKey.btmProgressBehavior,
|
||||
defaultValue: BtmProgresBehavior.values.first.code);
|
||||
@ -552,34 +555,33 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
|
||||
// 头部、底部控制条
|
||||
Obx(
|
||||
() => Visibility(
|
||||
visible: _.videoType.value != 'live',
|
||||
child: Column(
|
||||
children: [
|
||||
if (widget.headerControl != null)
|
||||
ClipRect(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: AppBarAni(
|
||||
controller: animationController,
|
||||
visible: !_.controlsLock.value && _.showControls.value,
|
||||
position: 'top',
|
||||
child: widget.headerControl!,
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
() => Column(
|
||||
children: [
|
||||
if (widget.headerControl != null)
|
||||
ClipRect(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: AppBarAni(
|
||||
controller: animationController,
|
||||
visible: !_.controlsLock.value && _.showControls.value,
|
||||
position: 'bottom',
|
||||
child: BottomControl(
|
||||
controller: widget.controller,
|
||||
triggerFullScreen: widget.controller.triggerFullScreen),
|
||||
position: 'top',
|
||||
child: widget.headerControl!,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
ClipRect(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: AppBarAni(
|
||||
controller: animationController,
|
||||
visible: !_.controlsLock.value && _.showControls.value,
|
||||
position: 'bottom',
|
||||
child: widget.bottomControl ??
|
||||
BottomControl(
|
||||
controller: widget.controller,
|
||||
triggerFullScreen:
|
||||
widget.controller.triggerFullScreen),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@ -598,6 +600,10 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
!_.isFullScreen.value) {
|
||||
return Container();
|
||||
}
|
||||
|
||||
if (_.videoType.value == 'live') {
|
||||
return Container();
|
||||
}
|
||||
if (value > max || max <= 0) {
|
||||
return Container();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user