uploadVideoWithThumbnail method
Future<T>
uploadVideoWithThumbnail(
- String memberMediumDocumentID,
- VideoWithThumbnail videoWithThumbnail, {
- FeedbackProgress? feedbackProgress,
Implementation
Future<T> uploadVideoWithThumbnail(
String memberMediumDocumentID, VideoWithThumbnail videoWithThumbnail,
{FeedbackProgress? feedbackProgress}) async {
var fileInfo = await UploadInfo.uploadData(
videoWithThumbnail.videoData.baseName,
videoWithThumbnail.videoData.data,
app.documentID,
ownerId,
packageName,
readAccessCustomMetaData(),
feedbackProgress: (progress) => _feedBackAggregatedProgress(
1, 3, progress,
feedbackProgress: feedbackProgress));
var thumbnailInfo = await UploadInfo.uploadData(
videoWithThumbnail.thumbNailData.baseName,
videoWithThumbnail.thumbNailData.data,
app.documentID,
ownerId,
packageName,
readAccessCustomMetaData(),
feedbackProgress: (progress) => _feedBackAggregatedProgress(
2, 3, progress,
feedbackProgress: feedbackProgress));
if (fileInfo == null) {
throw Exception(
'Unable to upload video with thumbnail with baseName = $basename. fileInfo is null ');
}
if (thumbnailInfo == null) {
throw Exception(
'Unable to upload video with thumbnail with baseName = $basename. thumbnailInfo is null ');
}
var returnMe = await videoWithThumbnailToMediumModel(
memberMediumDocumentID,
videoWithThumbnail.thumbNailData.baseName,
fileInfo,
thumbnailInfo,
videoWithThumbnail);
_feedBackAggregatedProgress(3, 3, 1, feedbackProgress: feedbackProgress);
return returnMe;
}