简体   繁体   中英

How to upload video with Title & description to Firebase using flutter?

 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);

}

这是我的 Firebase 存储的视图,也在这里键入显示图像

You can only save your videoLink, description, and title to the Firestore database after uploading the video to the Firebase storage.

https://pub.dev/packages/cloud_firestore

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM