fix: 视频播放异常
This commit is contained in:
@ -78,7 +78,9 @@ class Dash {
|
||||
duration = json['duration'];
|
||||
minBufferTime = json['minBufferTime'];
|
||||
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'];
|
||||
flac = json['flac'] ?? '';
|
||||
}
|
||||
|
@ -125,7 +125,8 @@ class VideoDetailController extends GetxController
|
||||
PlayUrlModel data = result['data'];
|
||||
// 指定质量的视频 -> 最高质量的视频
|
||||
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,
|
||||
defaultST: Duration(milliseconds: data.lastPlayTime!));
|
||||
}
|
||||
|
Reference in New Issue
Block a user