gotubecast icon indicating copy to clipboard operation
gotubecast copied to clipboard

Auto play next video in the list

Open d0uub opened this issue 7 years ago • 2 comments

That would be perfect if implement auto play next video

d0uub avatar Oct 30 '17 12:10 d0uub

Can you make it to play next song?

pera14 avatar Mar 13 '18 13:03 pera14

Currently this is not trivial to implement because gotubecast only communicates one way, from the YT API to the output stream (which is read by e.g. a shell script which passes commands to a video player). So gotubecast can't know the exact current position in the video, especially when the script uses youtube-dl, which takes a long time to analyze the stream URL.

To make this possible I need to implement two way communication first, so the player can give commands to gotubecast (when the playback is finished, play/pause/volume commands from the player). Maybe input stream commands (or a simple FIFO pipe/unix socket) are sufficient here, but for larger applications (kodi extension etc.) it might make sense to write a separate library for the YT TV API (preferably in python) so the app can coordinate playback between API and player.

However, I could implement a simple playtime estimation based on the video length so gotubecast assumes the end of the video playback and triggers the next video playback to the API. This would be inaccurate so sometimes the next video would start too early or late...

UPDATE: actually I see a lot of potential in integrating https://github.com/subogero/omxd. If anyone comes up with a nice shell script solution leveraging omxd for autoplay or playlist management in general together with gotubecast, don't hesitate to create a PR here so we can add it to the other examples!

cbix avatar Aug 22 '18 21:08 cbix