mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: 新增未播放的初始态;黑屏后仍可随播放状态显示出播放器
This commit is contained in:
@@ -46,7 +46,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
late BangumiIntroController bangumiIntroController;
|
||||
late String heroTag;
|
||||
|
||||
PlayerStatus playerStatus = PlayerStatus.playing;
|
||||
Rx<PlayerStatus> playerStatus = PlayerStatus.none.obs;
|
||||
double doubleOffset = 0;
|
||||
|
||||
final Box<dynamic> localCache = GStorage.localCache;
|
||||
@@ -157,7 +157,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
|
||||
// 播放器状态监听
|
||||
void playerListener(PlayerStatus? status) async {
|
||||
playerStatus = status!;
|
||||
playerStatus.value = status!;
|
||||
if (status == PlayerStatus.completed) {
|
||||
shutdownTimerService.handleWaitingFinished();
|
||||
bool notExitFlag = false;
|
||||
@@ -387,12 +387,13 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
Widget plPlayer = FutureBuilder(
|
||||
future: _futureBuilderFuture,
|
||||
builder: (BuildContext context, AsyncSnapshot snapshot) {
|
||||
if (snapshot.hasData && snapshot.data['status']) {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
return Obx(
|
||||
() => !videoDetailController.autoPlay.value ||
|
||||
plPlayerController == null ||
|
||||
plPlayerController!.videoController == null
|
||||
? nil
|
||||
plPlayerController!.videoController == null ||
|
||||
playerStatus.value == PlayerStatus.none
|
||||
? Text(playerStatus.value.toString())
|
||||
: PLVideoPlayer(
|
||||
controller: plPlayerController!,
|
||||
videoIntroController:
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import 'package:get/get.dart';
|
||||
|
||||
enum PlayerStatus { completed, playing, paused }
|
||||
enum PlayerStatus { completed, playing, paused, none }
|
||||
|
||||
class PlPlayerStatus {
|
||||
Rx<PlayerStatus> status = Rx(PlayerStatus.paused);
|
||||
Rx<PlayerStatus> status = Rx(PlayerStatus.none);
|
||||
|
||||
bool get none {
|
||||
return status.value == PlayerStatus.none;
|
||||
}
|
||||
|
||||
bool get playing {
|
||||
return status.value == PlayerStatus.playing;
|
||||
|
||||
Reference in New Issue
Block a user