Skip to content

[Bug]: Livestreams do not play / buffer and eventually stop #145

Description

@hugoghx

What happened?

First of all, thank you for making TypeType, and generally for your efforts in this space, it's great! :D

I've noticed that when playing livestreams, while it'll play for a bit, it'll eventually start buffering and then stop and a playback fail error appears.

Sometimes it doesn't play whatsoever from the start.

I opened the browser web tools and noticed that the player makes HLS playlist requests (to https://manifest.googlevideo.com/api/manifest/hls_playlist proxied via the backend) at a crazy fast rate (multiple per second).

The reason the playback buffers and eventually stops is because we're doing so many requests so fast that eventually YouTube rate-limits us and starts returning 429s.

From what I can tell, YouTube just returns the same playlist over and over because the requests happen so fast that there aren't really any updates for the segments, so they're just the same.

There are also quite a lot of segments in the manifest, and there's only usually one segment request from the player per 6-8 manifest requests, so I don't think the player is doing this out of not having enough segments.

(PS: I also noticed that livestreams don't seem to show up on the subscriptions feed)

Steps to reproduce

  1. Open any livestream (I've been using a 24/7 live for testing like https://youtu.be/X4VbdwhkE10)
  2. Verify that eventually it starts buffering as YouTube rate-limits the manifest requests.
  3. Playback stops when the player reaches the end of the segments it was able to get.

Sometimes we get "Playback failed" error almost immediately.

Area

Not sure

Channel

main (stable)

Anything else?

See screenshot for how the player is behaving in terms of network requests. In this point in time, it's just requesting the same playlist over and over and not getting any segment at all. Additionally, sometimes, I've noticed that it'll stop making manifest requests and download a bunch of segments at once, which seems anomalous. I might be incorrect but in my experience on how these players work. At least for live playback, without any user seek, I expected the network traffic to be:

  • Manifest
  • Segment
  • Segment
  • Segment
  • Segment
  • ...
  • Manifest
  • Segment
  • Segment
  • Segment
  • ...

Where as now I see:

  • Manifest
  • Manifest
  • Manifest
  • Manifest
  • Manifest
  • Manifest
    ...

I also don't think it's a lack of segments. In the example above (https://youtu.be/X4VbdwhkE10), YouTube was actually returning a manifest with over 3500 segments (likely because YouTube supports seeking 12h to the past on lives on their player).

It's also unlikely that the player is only looking at the last few segments and eventually starving and then making playlist requests over and over to get new ones. Each segment is usually 2s of video and the player is making multiple playlist requests per second.

I'm using Brave Browser v1.91.180.
On Chromium 151.0.7910.0 it doesn't play at all (Immediate "Playback failed" error).

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions