iBicha / playlet

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

Casting / Lounge API issues #310

Open iBicha opened 8 months ago

iBicha commented 8 months ago

The integration with Cast from YouTube has many issues and limitations, that I decided to group them into one ticket to classify them. If you notice issues related to the Casting functionality, comment on this issue.

1. YouTube mobile app overrides the current queue and screw up the currently playing video

To reproduce:

  1. Start Playlet
  2. Play a playlist (e.g. a playlist with 50 videos, and playing video n 3)
  3. Connect from YouTube mobile app
  4. Add a video to queue
  5. Now the list is overridden (the queue now contains only 2 videos) and the index is wrong (it shows Queue (3/2))

2. Changing the volume on the app does not change it in Playlet

This is a Roku OS limitation. Playlet can't control the volume. But it can mute the video. In this case, if the volume is set to 0, Playlet mutes the video. Any other value, Playlet unmutes. This is considered solved, as there isn't much more to do about it.

3. Voice search from the YouTube mobile app does not work

Playlet currently ignore voice search commands. This is doable, it was simply not implemented yet.

4. "Remote" (D-pad buttons) do not work

Sending remote button presses from Playlet itself to itself is not possible. This means in order to make this feature work, all button handling logic must be rewritten for the entire app. It's doable, just not planned yet.

5. Duplicate "Playlet on Roku" devices in the Cast to dialog

This can happen when you link to Playlet using the Link with TV code option, and then disconnect, restart Playlet and open the cast dialog on the Phone. Playlet changes its device identifier after each restart (for privacy reasons) so YouTube can mistake these different IDs for different devices. Playlet tries to send a "disconnect" signal to make sure devices don't get stuck, but they take longer when you use the Link with TV code option. Either way, these duplicate entires expire after a while (and they disappear when you can't connect to them)

6. Toggling and/or changing the Captions language from the phone does not work

This is simply not implemented yet.

7. Can't play next video (auto play) if we're currently playing the last video in the queue

If we are playing the next video in the queue, the "next" button on the phone should be enabled (if autoplay setting is enabled) and allow us to play the next related video. This is currently not properly implemented.

8. Changing the queue from Playlet or web app does not reflect in YouTube mobile app

You can add to queue from Playlet or from web app, or even clear the queue entirely. The changes will not be propagated to the YouTube mobile app, but cause we're not sending any messages related to these events.

9. Unknown SID spammed error

In some cases the session id gets invalidated. In this case, the long polling keeps getting a 400 error

[ERROR][LongPoller.bs:193] Http status code: 400
[ERROR][LongPoller.bs:194] Response data: HTTP/1.1 400 Unknown SID
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: Mon, 01 Jan 1990 00:00:00 GMT
Date: Thu, 28 Mar 2024 02:51:58 GMT
Content-Type: text/html; charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Server: GSE
Accept-Ranges: none
Vary: Accept-Encoding
Transfer-Encoding: chunked

ac
<HTML>
<HEAD>
<TITLE>Unknown SID</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<!-- GSE Default Error -->
<H1>Unknown SID</H1>
<H2>Error 400</H2>
</BODY>
</HTML>

0

And it is spammed over and over to the logs. We need to handle this error with trying to reestablish a new session with the same token lounge.

It looks like we mostly lose the session when the screensaver is on. This is (potentially) fixed by allowing the session to be refreshed when it is invalid.

10. Changing window size in the browser restarts video on Playlet

To reproduce:

11. Disconnecting and connecting causes the current video to start over

To reproduce:

12. Casting clips doesn't start the video from the right position

When casting a clip, the video starts from the beginning of the video, not from the beginning of the clip. This is because Playlet ignores player params, which contains the start time of the clip. After the video starts, seeking using the mobile app fixes this though.