Fix live premieres being treated as non-live videos #3358
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix live premieres being treated as non-live videos
Pull Request Type
Related issue
closes #3310
Description
Currently we detect live videos on the watch page by checking isLive and isLiveContent, that is fine for normal live streams but for currently live premiere videos, the isLiveContent property is set to false. That caused live premiere videos to be treated as normal videos, causing errors.
I've now switched the check to just isLive. isLiveContent is still useful for detecting live stream replays, which we use to show a "streamed on x" text instead of "published on x" text.
Another way to look at it, is that anything with isLive and isLiveContent set to true, is being streamed from somewhere to YouTube and then to you, anything with isLive set to true but isLiveContent set to false, is already entirely on YouTube's servers so it's only getting streamed from YouTube to you.
Testing
Find a stream on https://www.youtube.com/@live (click on the live now header to see all of them that are currently live) that is live but is marked as premiere (scrolling down to load more and CTRL+F is your friend), you may have to use the 3 dots menu in the top right of the website to change location if there aren't any listed for your current location.
Desktop