Skip to content

Commit

Permalink
mod: 播放停止/完成时,appBar可收起
Browse files Browse the repository at this point in the history
  • Loading branch information
guozhigq committed Sep 2, 2023
1 parent 72b1116 commit ff47aff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 28 deletions.
3 changes: 1 addition & 2 deletions lib/pages/video/detail/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>

// 播放器状态监听
void playerListener(PlayerStatus? status) {
playerStatus = status!;
if (status == PlayerStatus.completed) {
// 结束播放退出全屏
if (autoExitFullcreen) {
Expand Down Expand Up @@ -163,8 +164,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
Scaffold(
resizeToAvoidBottomInset: false,
key: videoDetailController.scaffoldKey,
// fix 1px black line
// backgroundColor: Colors.transparent,
backgroundColor: Colors.black,
body: ExtendedNestedScrollView(
controller: _extendNestCtr,
Expand Down
34 changes: 8 additions & 26 deletions lib/plugin/pl_player/widgets/bottom_control.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,13 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget {
fontSize: 12,
);

return AppBar(
backgroundColor: Colors.transparent,
foregroundColor: Colors.white,
elevation: 0,
scrolledUnderElevation: 0,
primary: false,
toolbarHeight: 85,
automaticallyImplyLeading: false,
titleSpacing: 14,
title: Column(
return Container(
color: Colors.transparent,
height: 85,
padding: const EdgeInsets.only(left: 14, right: 14),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
const SizedBox(height: 17),
Obx(
() {
final int value = _.sliderPosition.value.inSeconds;
Expand All @@ -45,7 +40,7 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget {
return Container();
}
return Padding(
padding: const EdgeInsets.only(left: 7, right: 5, bottom: 6),
padding: const EdgeInsets.only(left: 7, right: 7, bottom: 6),
child: ProgressBar(
progress: Duration(seconds: value),
buffered: Duration(seconds: buffer),
Expand Down Expand Up @@ -76,20 +71,6 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget {
),
Row(
children: [
// Obx(
// () => ComBtn(
// icon: Icon(
// _.playerStatus.paused
// ? FontAwesomeIcons.play
// : _.playerStatus.playing
// ? FontAwesomeIcons.pause
// : FontAwesomeIcons.rotateRight,
// size: 15,
// color: Colors.white,
// ),
// fuc: () => _.togglePlay(),
// ),
// ),
PlayOrPauseButton(
controller: _,
),
Expand Down Expand Up @@ -158,6 +139,7 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget {
),
],
),
const SizedBox(height: 10),
],
),
);
Expand Down

0 comments on commit ff47aff

Please sign in to comment.