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

Subtitles on Chromecast #530

Closed
mderazon opened this issue May 17, 2016 · 4 comments
Closed

Subtitles on Chromecast #530

mderazon opened this issue May 17, 2016 · 4 comments

Comments

@mderazon
Copy link

New subtitles feature works really well, thank you very much for that!

You think it's technically possible to have them show in Cast mode, at least for Chromecast ? From what I see the underlying lib should support it, right? (https://github.com/mafintosh/chromecasts#playersubtitlestrack-cb)

@feross
Copy link
Member

feross commented May 17, 2016

Yep, we can support this.

@mderazon
Copy link
Author

mderazon commented May 17, 2016

Started digging a little bit to see if I can implement this easily and found out the following:

  1. Only .vtt is supported - Need to convert srt to vtt
  2. Subtitles would have to be loaded up front when the cast initializes and not "hot loaded" while the movie is playing on chromecast - see play() doc: https://github.com/mafintosh/chromecasts#playerplayurl-opts-cb. subtitles() is only used to switch between active tracks. This means that users will have to first load subtitles and then cast. Not a deal breaker IMO
  3. Passing a subtitle file to chromecast through node-castv2-client is not as straight forward as passing a buffer. It expects a file url instead, sitting on a server with CORS enabled. see - https://github.com/thibauts/node-castv2-client/wiki/How-to-use-subtitles-with-the-DefaultMediaReceiver-app. Probably doable, not sure how as i'm not very familiar with Electron. Looks like it has been done before: mafintosh/playback@968b985#diff-168726dbe96b3ce427e7fedce31bb0bcR343

Thoughts?

@feross
Copy link
Member

feross commented May 18, 2016

  1. We already have code to convert .srt to .vtt. This is pretty straightforward.
  2. This is no problem! We have the torrent file list upfront so we can pass all files that are .vtt into player.play().
  3. We are already running a server using torrent.createServer() that supports CORS. So we can reference any file in the torrent by URL. We can pass the .vtt ones directly into player.play(), but we'll need to extend the server to convert .srt files into .vtt on the fly.

@mderazon
Copy link
Author

mderazon commented Oct 14, 2016

we'll need to extend the server to convert .srt files into .vtt on the fly

Are you talking about extending it from within webtorrent's server ? Or do you want to extend it from webtorrent-desktop ?

I can probably do something like

server.prependListener('request', (req, res) => {
  // try to convert srt here ?
})

@lock lock bot locked as resolved and limited conversation to collaborators Sep 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants