Future uploadtoServer () async{
print(videoFile);
StorageReference storageReference = FirebaseStorage.instance
.ref()
.child('video.mp4');
StorageUploadTask uploadTask = storageReference.putFile(videoFile, StorageMetadata(contentType: 'video.mp4'));
StorageTaskSnapshot taskSnapshot=await uploadTask.onComplete;
Uri downloadUrl = (await uploadTask.onComplete).uploadSessionUri;
final String Url = downloadUrl.toString();
print(Url);
setState(() {
print(taskSnapshot);
});
return print(_uploadedFileURL);
}
You can only save your videoLink, description, and title to the Firestore database after uploading the video to the Firebase storage.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.