fix: 视频播放异常
This commit is contained in:
@ -78,7 +78,9 @@ class Dash {
|
|||||||
duration = json['duration'];
|
duration = json['duration'];
|
||||||
minBufferTime = json['minBufferTime'];
|
minBufferTime = json['minBufferTime'];
|
||||||
video = json['video'].map<VideoItem>((e) => VideoItem.fromJson(e)).toList();
|
video = json['video'].map<VideoItem>((e) => VideoItem.fromJson(e)).toList();
|
||||||
audio = json['audio'].map<AudioItem>((e) => AudioItem.fromJson(e)).toList();
|
audio = json['audio'] != null
|
||||||
|
? json['audio'].map<AudioItem>((e) => AudioItem.fromJson(e)).toList()
|
||||||
|
: [];
|
||||||
dolby = json['dolby'];
|
dolby = json['dolby'];
|
||||||
flac = json['flac'] ?? '';
|
flac = json['flac'] ?? '';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -125,7 +125,8 @@ class VideoDetailController extends GetxController
|
|||||||
PlayUrlModel data = result['data'];
|
PlayUrlModel data = result['data'];
|
||||||
// 指定质量的视频 -> 最高质量的视频
|
// 指定质量的视频 -> 最高质量的视频
|
||||||
String videoUrl = data.dash!.video!.first.baseUrl!;
|
String videoUrl = data.dash!.video!.first.baseUrl!;
|
||||||
String audioUrl = data.dash!.audio!.first.baseUrl!;
|
String audioUrl =
|
||||||
|
data.dash!.audio!.isNotEmpty ? data.dash!.audio!.first.baseUrl! : '';
|
||||||
playerInit(videoUrl, audioUrl,
|
playerInit(videoUrl, audioUrl,
|
||||||
defaultST: Duration(milliseconds: data.lastPlayTime!));
|
defaultST: Duration(milliseconds: data.lastPlayTime!));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user