videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
38.06k stars 7.45k forks source link

Subtitles not showing #7987

Open sadhashivamp opened 2 years ago

sadhashivamp commented 2 years ago

Description

Actually we uploaded video file with subtitle vtt file at azure portal

So here problem is when we change the access level to public then subtitle showing and if private not showing we need to maintain vtt file to private only and we need to show subtitle on my player

How to access that vtt file and how to show subtitles

Reduced test case

No response

Steps to reproduce

1. 2. 3.

Errors

network tab : for vtt Status Code: 404 The specified resource does not exist.

What version of Video.js are you using?

latest version

Video.js plugins used.

No response

What browser(s) including version(s) does this occur with?

Chrome

What OS(es) and version(s) does this occur with?

windows 11

welcome[bot] commented 2 years ago

👋 Thanks for opening your first issue here! 👋

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines.

mister-ben commented 2 years ago

If you're using a URL to a VTT file, the URL file has to be accessible.

If you can retrieve your cues some other way, you can use a programmatic track and add each cue to it:

const track = player.addTextTrack('subtitles', 'English', 'en');
track.addCue({startTime: 1, endTIme: 4, text: 'Now this is the story all about how'});
MadheshKumarVJ commented 3 months ago

To access and display a private subtitle (VTT) file in your video player while keeping the file private, you typically need to generate a signed URL or use a proxy method

  1. A signed URL is a temporary, time-limited URL that grants access to the private VTT file.
  2. A proxy server can fetch the private VTT file and serve it to the client.

https://videojs.com/guides/text-tracks/