iBicha / playlet

The unofficial, privacy driven, YouTube client for Roku
GNU Affero General Public License v3.0
282 stars 11 forks source link

[BUG] Can't Rewind or Pause LIVE videos #261

Open Neipas09 opened 6 months ago

Neipas09 commented 6 months ago

On the official YT app, i can rewind LIVE streams back to the beginning, and I can pause the video and resume it from the point i pause. But on your app i can't do either. In fact, no progress bar shows up at all for LIVE streams.

iBicha commented 6 months ago

This is going to take a while to figure out, but I'll just leave notes for myself later: Innertube returns HLS manifests with different durations based on client type:

Invidious will return web by default, unless it fails, then it tries something else.

The official youtube app should be a TVHTML5. The official app might be using DASH, but DASH manifests for live are gigantic and Roku fails to parse them. Using this trick https://github.com/iv-org/invidious/pull/4196/files to reduce the size of the manifest, still won't play it for some reason.

absidue commented 4 months ago

@iBicha There are multiple reasons that it could be failing to play the live stream DASH, here are two potential ones:

  1. If you are attempting to proxy it through Invidious, you'll run into playback issues. Invidious' video proxy doesn't support live DASH, they already know about the problem (I reached out to them about it because of FreeTube), although it is probably a low-priority issue for them, as Invidious itself cannot use DASH for live streams, see point 2
  2. YouTube's DASH live streams use so called self-initialising segments, which are discouraged by the DASH interoperability guidelines and therefore not supported in all players. shaka-player supports them, video.js, the player than both Invidious and FreeTube currently use, doesn't. You will need to check if Roku's player supports self-initialising segments, otherwise you will have to stick to HLS for the livestreams.
iBicha commented 4 months ago

Thanks @absidue, after many attempts, I realized my only option is HLS. Although I sifted through the Roku Support https://developer.roku.com/en-ca/docs/specs/media/dash-if.md I can't pinpoint why the live DASH is not working. Also in their guide https://developer.roku.com/en-ca/docs/developer-program/media-playback/trick-mode/hls-and-dash.md they only mention HLS with live streaming. So perhaps in this case is to have the API return the HLS from the iOS client, and that would give us an hour, maybe?

iBicha commented 4 months ago

I just made a change to Invidious locally to get YoutubeAPI::ClientType::IOS streaming data instead of Android, and Roku seems to take the stream fine. Two weird things

It's a start, but this needs to be exposed in the Invidious API somehow