Skip to content
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

Having issue adding Captions #149

Open
HariShankarS opened this issue Jun 14, 2019 · 0 comments
Open

Having issue adding Captions #149

HariShankarS opened this issue Jun 14, 2019 · 0 comments

Comments

@HariShankarS
Copy link

The text tracks I am adding to the videojs player are not being displayed in the player.

I could add remoteTextTrack and I could see the cues being added to the Text track in the console, but for all the cues the displayState is showing as undefined, which is the reason the captions are not rendering. Couldn't understand why this is happening.

This is how I am adding :

playerRef.remoteTextTracks().tracks_.forEach(remoteTrack => {
  const currCue = new VTTCue(stTime, enTime, "HARI SHANKAR");
  remoteTrack.addCue(currCue);
});

This is the response I am getting in the console for the
VTTCue:

0: VTTCue
addEventListener: ƒ addEventListener()
align: "middle"
dispatchEvent: ƒ dispatchEvent()
displayState: undefined
endTime: 5
hasBeenReset: false
id: ""
line: "auto"
lineAlign: "start"
onenter: null
onexit: null
originalCue_: VTTCue {vertical: "", snapToLines: true, line: "auto", position: "auto", size: 100, …}
pauseOnExit: false
position: 50
positionAlign: "middle"
region: null
removeEventListener: ƒ removeEventListener()
size: 50
snapToLines: true
startTime: 0
text: "HARI SHANKAR"
track: null
vertical: "" 

I have also tried by adding VTT file using <track> as :

<video ref={node => (this.videoNode = node)} className="video-js">
  <track kind="captions" src="/sample.vtt" srcLang="en-US"label="English" />
</video>

even this way I couldn't get any captions. Can someone help ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant