-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add support for subtitles on Chromecast #1165
Conversation
any update on this? i love the player but i usually cast my videos and not having subtitles is kind of a deal breaker, so this would be awesome |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, important feature
src/renderer/lib/cast.js
Outdated
cb() | ||
} else { | ||
ret.subServer = http.createServer((req, res) => { | ||
if (!selectedSubtitle) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this code will ever be reached because selectedSubtile
has already been checked for a value in the above if
clause.
src/renderer/lib/cast.js
Outdated
@@ -130,22 +132,51 @@ function chromecastPlayer () { | |||
}) | |||
} | |||
|
|||
function serveSubtitles (cb) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In all functions in this file callback arguments are called callback
, probably best to keep this consistent.
src/renderer/lib/cast.js
Outdated
state.playing.location = 'chromecast' | ||
} | ||
update() | ||
serveSubtitles(function (subtitles) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the subtitles
variable is not actually an array of subtitles it makes more sense to use the same name as used before in the serveSubtitles
function - namely subtitlesUrl
.
171c1ab
to
f7ec537
Compare
Hi all! Would be amazing to have this PR merged!!! |
This looks like a useful PR. Will find a Chromecast to test it on as soon as I can |
Any update on this? |
Hey there, I built the master branch and cherry-picked janza@2508701 and it works! |
Just did the same here like @gonzaloserrano did, and it worked for me too! Nice job @janza! @feross Any change to merge this PR? |
I've tested this PR and it seems to work on both my Phillips TV's built-in Chromecast, a Chromecast Gen. 1, and the Chromecast Ultra without any problems. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On behalf of all the friendly folks who reviewed this change I I will approve this change. First of all, thanks a lot for all that work! I do not have Chromecast device myself so I completely rely on you folks.
Support subtitles on Chromecast by creating a new http server for selected subtitles before calling player.play()
Closes #530