-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store external text tracks alongside main content #2016
Comments
Yes, absolutely. The Storage API will allow you to choose which tracks (including text tracks) to store offline. There is a configurable callback ( |
In my case, I'm using external text tracks and adding them through the addTextTrack method. Any possibility on persisting external tracks? |
Ah, I see! No, we don't have that today, but I will add it to our backlog as an enhancement. |
cool, for anyone who might be bumping into this here's my solution:
|
Again, for anyone bumping into this, another solution that does not require a local http server to serve the text track files with http protocol :
const { textTracks } = appMetadata;
const addedTextTracks = await Promise.all(
textTracks.map(({ data, language, kind, mime, label }: TextTrackDefinition) => {
const blob = new Blob([data], { type: mime });
const url = URL.createObjectURL(blob);
return player.addTextTrackAsync(url, language, kind, mime, undefined, label);
})
);
// eslint-disable-next-line no-console
console.log(`Added ${addedTextTracks.length} text tracks`);
if (addedTextTracks.length > 0) {
player.selectTextTrack(addedTextTracks[0]);
player.setTextTrackVisibility(true);
} |
Hi, Is it possible to store/download subtitle files using the Offline Storage api?
Right now I'm persisting the videos but not the .vtt files.
The text was updated successfully, but these errors were encountered: