mafintosh/chromecasts

Keee player and chromecast almost synced

Opened this issue · 0 comments

Hi everyone,
I have a player playing a video. I push a button and the video is sent to chromecast, with actual time so it starts the video at the same time (the player is still playing it). Chromecast get some seconds to start and in the meanwhile video on the player continues to play. So when both are playing there is a big difference in time of what player and chromecast are playing.
E.g. player is at 1:10 and Chromecast is at 1:00. I'd like to reduce this gap.
What I was thinking to do is.
When I push the button i send the video to chromecast and pause the video on the player.
When chromecast really starts playing the video I restart it also on the player... so player and chromecast are almost synced.

But I cannot find a way to understand when chromecast starts playing. I tried to get the chromecast status but I cannot. Maybe related to #22, But I'm not getting undefined.
The command I use is chromecasts.players[0].status() (player[0] is the chromecast I'm using)
I'm getting this error:

Uncaught TypeError: callback is not a function at C:\Users\ivan\Desktop\Myapp\chromecast\node_modules\castv2-client\lib\controllers\media.js:41 at fn.onmessage (C:\Users\ivan\Desktop\Myapp\chromecast\node_modules\castv2-client\lib\controllers\request-re…:27) at emitTwo (events.js:130) at fn.emit (events.js:213) at Channel.onmessage (C:\Users\ivan\Desktop\Myapp\chromecast\node_modules\castv2-client\lib\controllers\controller…:16) at emitTwo (events.js:125) at Channel.emit (events.js:213) at Client.onmessage (C:\Users\ivan\Desktop\Myapp\chromecast\node_modules\castv2\lib\channel.js:23) at emitMany (events.js:151) at Client.emit (events.js:223)

Any idea about this error? Or any other way to solve my sync "issue"?
Thank you!