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

Captions with Shaka Player #750

Open
samanmohamadi opened this issue Jan 5, 2018 · 5 comments
Open

Captions with Shaka Player #750

samanmohamadi opened this issue Jan 5, 2018 · 5 comments

Comments

@samanmohamadi
Copy link

samanmohamadi commented Jan 5, 2018

using shaka player I couldn't add a track to player nor manually neither programmatically.

Manually

placing <track src="src" kind="subtitles" > inside <video>

Programatically

using shaka player addTextTrack(uri, language, kind, mime, opt_codecopt, opt_labelopt) method

In both ways, the vtt file is fetched from the server but it doesn't show anything. using first method cause a cc icon appear next to the volume control but it doesn't do anything.

@friday
Copy link
Collaborator

friday commented May 17, 2018

You can use HTML5 <track> elements if you have subtitles in the WebVTT format. If this isn't the case you may want to handle the conversion server side.

Shaka doesn't quite play by the standard rules, so you we can't handle it like the other libraries. See #994

@friday friday changed the title set track when streaming Captions with Shaka Player May 31, 2018
@samanmohamadi
Copy link
Author

I managed this issue by overriding textDisplayFactory of shaka-player:

shakaPlayer.configure({
   textDisplayFactory: () => {
      return {
         setTextVisibility: () => {},
         isTextVisible: () => true,
         destroy: () => { }
      }
   }
 });

@friday
Copy link
Collaborator

friday commented Jun 4, 2018

Thanks for the update!

I'm not sure what that does though? Does it make Shaka Player use multiple tracks (one per language) like the other libraries (see #994). I'm guessing not?

@samanmohamadi
Copy link
Author

according to shaka-project/shaka-player#1443 I Implement a custom text displayer for shaka which does nothing and let plyr handle displaying captions.

@friday
Copy link
Collaborator

friday commented Jun 4, 2018

Thanks! I'll leave this open until there's a full example of how to use Plyr with Shaka Player and captions, or if I write one myself. I prefer not to have to dig into the Shaka Player api again.

@friday friday added this to the Undecided milestone Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants