Reputation: 85
I want to store videos along with their thumbnails (expo-video-thumbnails) using Expo with a Firebase back-end. I can pass videos through my fetch function but whenever I try doing the same with the thumbnails I catch a 'Network request failed' error.
I've been trying to fix this for a while now without success. Here is my code - I'd gladly appreciate some help with this!
export const saveMediaToStorage = (media, path) => new Promise((resolve, reject) => {
const fileRef = firebase.storage().ref().child(path)
fetch(media)
.then(response => response.blob())
.then(blob => fileRef.put(blob))
.then(task => task.ref.getDownloadURL())
.then(downloadUrl => resolve(downloadUrl))
// .catch(() => reject())
.catch((e) => {console.error(e)})
})
Edit: I am using an Android Emulator
Upvotes: 0
Views: 70