I have the following code:
const downloadVideo = async (uri: string) => {
var filename = `teste`;
await RNFetchBlob
.config({
fileCache: true,
path: `${RNFS.ExternalDirectoryPath}/downloads/${filename}`,
})
.fetch(
"GET",
uri,
{"Content-Type": "octet-stream",}
)
.progress({ interval: 1000 },(received, total) => {
console.log("progress", received / total);
}).then(resp => {
setVideoIsDownloaded(true)
}).catch(err => {
console.log(err)
})
}
I'm downloading videos that have subtitles, and I want to make them available offline in the app, but how can I download the subtitle files, as well as video information in JSON (description, title that comes from the API) and insert all of this into a single file? it's possible?
I need to download the video file, the subtitle file and insert the video information that comes from the API in a single file and retrieve them later.
I'm using the rn-fetch-blob
library