Skip to content

Commit

Permalink
Revert "feat: 新增未播放的初始态;黑屏后仍可随播放状态显示出播放器"
Browse files Browse the repository at this point in the history
This reverts commit 7b5e695.
  • Loading branch information
VillagerTom committed Jul 13, 2024
1 parent 11f7d82 commit cb0d79d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
11 changes: 5 additions & 6 deletions lib/pages/video/detail/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
late BangumiIntroController bangumiIntroController;
late String heroTag;

Rx<PlayerStatus> playerStatus = PlayerStatus.none.obs;
PlayerStatus playerStatus = PlayerStatus.playing;
double doubleOffset = 0;

final Box<dynamic> localCache = GStorage.localCache;
Expand Down Expand Up @@ -157,7 +157,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>

// 播放器状态监听
void playerListener(PlayerStatus? status) async {
playerStatus.value = status!;
playerStatus = status!;
if (status == PlayerStatus.completed) {
shutdownTimerService.handleWaitingFinished();
bool notExitFlag = false;
Expand Down Expand Up @@ -387,13 +387,12 @@ class _VideoDetailPageState extends State<VideoDetailPage>
Widget plPlayer = FutureBuilder(
future: _futureBuilderFuture,
builder: (BuildContext context, AsyncSnapshot snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.hasData && snapshot.data['status']) {
return Obx(
() => !videoDetailController.autoPlay.value ||
plPlayerController == null ||
plPlayerController!.videoController == null ||
playerStatus.value == PlayerStatus.none
? Text(playerStatus.value.toString())
plPlayerController!.videoController == null
? nil
: PLVideoPlayer(
controller: plPlayerController!,
videoIntroController:
Expand Down
8 changes: 2 additions & 6 deletions lib/plugin/pl_player/models/play_status.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import 'package:get/get.dart';

enum PlayerStatus { completed, playing, paused, none }
enum PlayerStatus { completed, playing, paused }

class PlPlayerStatus {
Rx<PlayerStatus> status = Rx(PlayerStatus.none);

bool get none {
return status.value == PlayerStatus.none;
}
Rx<PlayerStatus> status = Rx(PlayerStatus.paused);

bool get playing {
return status.value == PlayerStatus.playing;
Expand Down

0 comments on commit cb0d79d

Please sign in to comment.