mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
@@ -34,6 +34,7 @@ class PlayUrlModel {
|
|||||||
String? seekParam;
|
String? seekParam;
|
||||||
String? seekType;
|
String? seekType;
|
||||||
Dash? dash;
|
Dash? dash;
|
||||||
|
List<Durl>? durl;
|
||||||
List<FormatItem>? supportFormats;
|
List<FormatItem>? supportFormats;
|
||||||
// String? highFormat;
|
// String? highFormat;
|
||||||
int? lastPlayTime;
|
int? lastPlayTime;
|
||||||
@@ -52,15 +53,8 @@ class PlayUrlModel {
|
|||||||
videoCodecid = json['video_codecid'];
|
videoCodecid = json['video_codecid'];
|
||||||
seekParam = json['seek_param'];
|
seekParam = json['seek_param'];
|
||||||
seekType = json['seek_type'];
|
seekType = json['seek_type'];
|
||||||
if (json['dash'] != null) {
|
dash = json['dash'] != null ? Dash.fromJson(json['dash']) : null;
|
||||||
dash = Dash.fromJson(json['dash']);
|
durl = json['durl']?.map<Durl>((e) => Durl.fromJson(e)).toList();
|
||||||
} else if (json['durl'] != null) {
|
|
||||||
//试看的充电包月视频可能出现没有dash只有durl的情况
|
|
||||||
var durlList = json['durl']
|
|
||||||
.map<Durl>((e) => Durl.fromJson(e))
|
|
||||||
.toList();
|
|
||||||
//TODO
|
|
||||||
}
|
|
||||||
supportFormats = json['support_formats'] != null
|
supportFormats = json['support_formats'] != null
|
||||||
? json['support_formats']
|
? json['support_formats']
|
||||||
.map<FormatItem>((e) => FormatItem.fromJson(e))
|
.map<FormatItem>((e) => FormatItem.fromJson(e))
|
||||||
|
|||||||
@@ -229,9 +229,11 @@ class VideoDetailController extends GetxController
|
|||||||
seekTo: seekToTime ?? defaultST,
|
seekTo: seekToTime ?? defaultST,
|
||||||
duration: duration ?? Duration(milliseconds: data.timeLength ?? 0),
|
duration: duration ?? Duration(milliseconds: data.timeLength ?? 0),
|
||||||
// 宽>高 水平 否则 垂直
|
// 宽>高 水平 否则 垂直
|
||||||
direction: (firstVideo.width! - firstVideo.height!) > 0
|
direction: firstVideo.width != null && firstVideo.height != null
|
||||||
|
? ((firstVideo.width! - firstVideo.height!) > 0
|
||||||
? 'horizontal'
|
? 'horizontal'
|
||||||
: 'vertical',
|
: 'vertical')
|
||||||
|
: null,
|
||||||
bvid: bvid,
|
bvid: bvid,
|
||||||
cid: cid.value,
|
cid: cid.value,
|
||||||
enableHeart: enableHeart,
|
enableHeart: enableHeart,
|
||||||
@@ -252,14 +254,19 @@ class VideoDetailController extends GetxController
|
|||||||
var result = await VideoHttp.videoUrl(cid: cid.value, bvid: bvid);
|
var result = await VideoHttp.videoUrl(cid: cid.value, bvid: bvid);
|
||||||
if (result['status']) {
|
if (result['status']) {
|
||||||
data = result['data'];
|
data = result['data'];
|
||||||
if (data.dash == null) {
|
if (data.acceptDesc!.isNotEmpty && data.acceptDesc!.contains('试看')) {
|
||||||
// isEffective.value = false;
|
SmartDialog.showToast(
|
||||||
if (data.acceptDesc != null) {
|
'该视频为专属视频,仅提供试看',
|
||||||
SmartDialog.showToast('当前视频acceptDesc为:${data.acceptDesc},不支持获取视频链接');
|
displayTime: const Duration(seconds: 3),
|
||||||
} else {
|
);
|
||||||
SmartDialog.showToast('当前视频未能获取视频链接');
|
videoUrl = data.durl!.first.url!;
|
||||||
|
audioUrl = '';
|
||||||
|
defaultST = Duration.zero;
|
||||||
|
firstVideo = VideoItem();
|
||||||
|
if (autoPlay.value) {
|
||||||
|
await playerInit();
|
||||||
|
isShowCover.value = false;
|
||||||
}
|
}
|
||||||
result['status'] = false;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
final List<VideoItem> allVideosList = data.dash!.video!;
|
final List<VideoItem> allVideosList = data.dash!.video!;
|
||||||
|
|||||||
@@ -227,7 +227,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
@override
|
@override
|
||||||
// 返回当前页面时
|
// 返回当前页面时
|
||||||
void didPopNext() async {
|
void didPopNext() async {
|
||||||
|
if (plPlayerController != null &&
|
||||||
|
plPlayerController!.videoPlayerController != null) {
|
||||||
setState(() => isShowing = true);
|
setState(() => isShowing = true);
|
||||||
|
}
|
||||||
videoDetailController.isFirstTime = false;
|
videoDetailController.isFirstTime = false;
|
||||||
final bool autoplay = autoPlayEnable;
|
final bool autoplay = autoPlayEnable;
|
||||||
videoDetailController
|
videoDetailController
|
||||||
|
|||||||
Reference in New Issue
Block a user