///对应阿里云 SDK 下载的 MediaInfo class class DownloadModel { String videoId; String title; String coverUrl; List trackInfos; DownloadModel({this.videoId, this.title, this.coverUrl, this.trackInfos}); DownloadModel.fromJson(Map jsonMap) { videoId = jsonMap['mVideoId']; title = jsonMap['mTitle']; coverUrl = jsonMap['mCoverUrl']; if (jsonMap['mTrackInfos'] != null) { trackInfos = []; jsonMap['mTrackInfos'].forEach((v) { trackInfos.add(TrackInfoModel.fromJson(v)); }); } } Map toJson() { final Map data = Map(); data['mVideoId'] = this.videoId; data['mTitle'] = this.title; data['mCoverUrl'] = this.coverUrl; if (this.trackInfos.isNotEmpty) { data['mTrackInfos'] = this.trackInfos.map((e) => e.toJson()).toList(); } return data; } } class TrackInfoModel { int index; int vodFileSize; String vodFormat; String vodDefinition; TrackInfoModel( {this.index, this.vodFileSize, this.vodFormat, this.vodDefinition}); TrackInfoModel.fromJson(Map jsonMap) { index = jsonMap['index']; vodFileSize = jsonMap['vodFileSize']; vodFormat = jsonMap['vodFormat']; vodDefinition = jsonMap['vodDefinition']; } Map toJson() { final Map data = Map(); data['index'] = this.index; data['vodFileSize'] = this.vodFileSize; data['vodFormat'] = this.vodFormat; data['vodDefinition'] = this.vodDefinition; return data; } }