Home > Back-end >  How to load videos from Firebase Storage and return them as React component?
How to load videos from Firebase Storage and return them as React component?

Time:05-14

I have a video stored in my firebase storage and and I'm able to access it's download URL from firebase and trying to do this:

const App = () => {
  var videoRef = storage.ref('myVideo.mp4')
  return (
    <video width="750" height="500" controls>
      <source src={videoRef.getDownloadURL()} />
    </video>
  )
}

There aren't any errors coming up in the console but it doesn't load the video.

Is there a way to do this?

Thank's in advance!

CodePudding user response:

if it is only one video you want to play, you can go to your firebase storage where you saved that video. Click on it, to your right you will see Name property. Right click on link below and copy link address. You can then do this:

<source src="put the link here" />
  • Related