File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
common/src/main/java/dev/lavalink/youtube/track Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -18,23 +18,26 @@ private TemporalInfo(boolean isActiveStream, long durationMillis) {
1818 // normal video? but has liveStreamability: PRRBJOn_n-Y
1919 // livestream: jfKfPfyJRdk
2020
21+ // active premieres have liveStreamability and videoDetails.isLive = true, videoDetails.isLiveContent = false.
22+ // they do retain their lengthSeconds value.
23+
2124 @ NotNull
2225 public static TemporalInfo fromRawData (JsonBrowser playabilityStatus , JsonBrowser videoDetails ) {
2326 JsonBrowser durationField = videoDetails .get ("lengthSeconds" );
2427 long durationValue = durationField .asLong (0L );
2528
26- boolean hasLivestreamability = !playabilityStatus .get ("liveStreamability" ).isNull ();
29+ // boolean hasLivestreamability = !playabilityStatus.get("liveStreamability").isNull();
2730 boolean isLive = videoDetails .get ("isLive" ).asBoolean (false )
2831 || videoDetails .get ("isLiveContent" ).asBoolean (false );
2932
30- if (hasLivestreamability ) {
33+ if (isLive ) { // hasLivestreamability
3134 // Premieres have duration information, but act as a normal stream. When we play it, we don't know the
3235 // current position of it since YouTube doesn't provide such information, so assume duration is unknown.
3336 durationValue = 0 ;
3437 }
3538
3639 return new TemporalInfo (
37- ( isLive || hasLivestreamability ) && durationValue == 0 ,
40+ isLive ,
3841 durationValue == 0 ? DURATION_MS_UNKNOWN : Units .secondsToMillis (durationValue )
3942 );
4043 }
You can’t perform that action at this time.
0 commit comments