mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
update part media item
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -136,11 +136,7 @@ class LiveRoomController extends GetxController {
|
||||
if (res['status']) {
|
||||
RoomInfoH5Data data = res['data'];
|
||||
roomInfoH5.value = data;
|
||||
videoPlayerServiceHandler.onVideoDetailChange(
|
||||
data,
|
||||
roomId,
|
||||
heroTag,
|
||||
);
|
||||
videoPlayerServiceHandler.onVideoDetailChange(data, roomId, heroTag);
|
||||
} else {
|
||||
if (res['msg'] != null) {
|
||||
_showDialog(res['msg']);
|
||||
|
||||
@@ -90,7 +90,7 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
||||
var res = await VideoHttp.videoIntro(bvid: bvid);
|
||||
if (res.isSuccess) {
|
||||
VideoDetailData data = res.data;
|
||||
videoPlayerServiceHandler.onVideoDetailChange(data, data.cid!, heroTag);
|
||||
videoPlayerServiceHandler.onVideoDetailChange(data, cid.value, heroTag);
|
||||
if (videoDetail.value.ugcSeason?.id == data.ugcSeason?.id) {
|
||||
// keep reversed season
|
||||
data.ugcSeason = videoDetail.value.ugcSeason;
|
||||
@@ -517,6 +517,17 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
||||
hasLater.value = videoDetailCtr.sourceType == SourceType.watchLater;
|
||||
this.bvid = bvid;
|
||||
queryVideoIntro();
|
||||
} else {
|
||||
if (episode is Part) {
|
||||
final videoDetail = this.videoDetail.value;
|
||||
videoPlayerServiceHandler.onVideoDetailChange(
|
||||
episode,
|
||||
cid,
|
||||
heroTag,
|
||||
artist: videoDetail.owner?.name,
|
||||
cover: videoDetail.pic,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
this.cid.value = cid;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:PiliPlus/models_new/live/live_room_info_h5/data.dart';
|
||||
import 'package:PiliPlus/models_new/pgc/pgc_info_model/episode.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_detail/data.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_detail/page.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/play_status.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
@@ -118,6 +119,7 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
|
||||
int cid,
|
||||
String herotag, {
|
||||
String? artist,
|
||||
String? cover,
|
||||
}) {
|
||||
if (!enableBackgroundPlay) return;
|
||||
// if (kDebugMode) {
|
||||
@@ -168,6 +170,14 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
|
||||
artUri: Uri.parse(data.roomInfo?.cover ?? ''),
|
||||
isLive: true,
|
||||
);
|
||||
} else if (data is Part) {
|
||||
mediaItem = MediaItem(
|
||||
id: id,
|
||||
title: data.pagePart ?? '',
|
||||
artist: artist,
|
||||
duration: Duration(seconds: data.duration ?? 0),
|
||||
artUri: Uri.parse(cover ?? ''),
|
||||
);
|
||||
}
|
||||
if (mediaItem == null) return;
|
||||
// if (kDebugMode) debugPrint("exist: ${PlPlayerController.instanceExists()}");
|
||||
|
||||
Reference in New Issue
Block a user