how can I upload a video hosted in firebase to a videoview?
var storageRef = FirebaseStorage.getInstance().reference.child("videos/$recivir.mp4")
val mediaController = MediaController(this)
mediaController.setAnchorView(videoView)
how can I upload a video hosted in firebase to a videoview?
var storageRef = FirebaseStorage.getInstance().reference.child("videos/$recivir.mp4")
val mediaController = MediaController(this)
mediaController.setAnchorView(videoView)
2
Answers
From the official documentation about how to download files with Cloud Storage on Android here https://firebase.google.com/docs/storage/android/download-files#download_files, you can download the media (your video) using
getBytes()
,getStream()
, orgetDownloadUrl()
, depends on what format you want to use.You can use
getDownloadUrl()
to get the url of the video in Firebase Storage and set the url into the video view.progressDialog.show()