patrickkfkan / volumio-youtube2

35 stars 7 forks source link

YouTube live streams only play momentarily #6

Closed AlinLA closed 1 year ago

AlinLA commented 2 years ago

Youtube2 working as expected in Volumio 2. latest versions. But not with live content. Is there a way to enable live YouTube streams? When I load one in volumio 2.0 it will eventually play but the UI seems to think it's only a few seconds long and it will stop or move to the next stream after about 5 seconds. example live stream: https://www.youtube.com/watch?v=21X5lGlDOfg

patrickkfkan commented 2 years ago

youtube2 won't support live streams because Volumio assumes all live streams have got to be webradio streams. See this code here (from Volumio 3 but same for V2):

https://github.com/volumio/volumio3-backend/blob/8b3e6f24b6d055dc597c25250dded8bef566af7b/app/statemachine.js#L112-L124

This code means all tracks with duration of zero seconds are to be identified as webradio streams. This includes YouTube live streams. From this point forth, the webradio plugin will take charge of certain functions. And this kind of control hijacking is obviously not wanted.

A workaround would be to set the youtube2 plugin as 'volatile', but that would involve adding a fair amount of rather messy code. I would not do it for something that should have been addressed within the Volumio codebase itself.

On the other hand, the YouTube Cast Receiver plugin is 'volatile' and supports YouTube live streams. You might want to try that (cast the stream from your phone to Volumio).

patrickkfkan commented 1 year ago

Closing as no longer the case (live stream support available since v1.0.1)