Skip to content

Conversation

@cmorley191
Copy link

This PR fixes lavaplayer to play YouTube Premiere videos correctly - currently the video begins playing (at the active premiere timestamp) then stops after a few seconds, instead of playing to the end.

YouTube Premieres are basically "pre-recorded livestreams" -- channels upload a video, then start an automated livestream that plays it back with all the usual livestream features (chat, etc.). Lavaplayer should treat these as livestreams in order to play them correctly, but Premieres show the pre-recorded video length which confuses lavaplayer into thinking it's a normal video.

A (possibly new?) videoDetails json key isLive is available to tell if a video is a currently-streaming livestream or Premiere. This PR updates lavaplayer to use that field to identify content that should be streamed.

Further bug details:

  • An easy use-case to check is "lofi" videos -- many lofi channels use both livestreams and premieres to provide their long-running content.
  • I have tested what youtube returns in the following cases:
    • A non-livestream, non-premiere video's json will have "isLiveContent": false, "lengthSeconds": <length>
    • An active livestream video's json will have "isLiveContent": true, "isLive": true, "lengthSeconds": 0
    • An ended/past livestream video's json will have "isLiveContent": true, "lengthSeconds": <length>
    • An active premiere video's json will have "isLiveContent": false, "isLive": true, "lengthSeconds": <length>
    • An ended/past premiere video's json will have "isLiveContent": false, "lengthSeconds": <length>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant