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) {
18
18
// normal video? but has liveStreamability: PRRBJOn_n-Y
19
19
// livestream: jfKfPfyJRdk
20
20
21
+ // active premieres have liveStreamability and videoDetails.isLive = true, videoDetails.isLiveContent = false.
22
+ // they do retain their lengthSeconds value.
23
+
21
24
@ NotNull
22
25
public static TemporalInfo fromRawData (JsonBrowser playabilityStatus , JsonBrowser videoDetails ) {
23
26
JsonBrowser durationField = videoDetails .get ("lengthSeconds" );
24
27
long durationValue = durationField .asLong (0L );
25
28
26
- boolean hasLivestreamability = !playabilityStatus .get ("liveStreamability" ).isNull ();
29
+ // boolean hasLivestreamability = !playabilityStatus.get("liveStreamability").isNull();
27
30
boolean isLive = videoDetails .get ("isLive" ).asBoolean (false )
28
31
|| videoDetails .get ("isLiveContent" ).asBoolean (false );
29
32
30
- if (hasLivestreamability ) {
33
+ if (isLive ) { // hasLivestreamability
31
34
// Premieres have duration information, but act as a normal stream. When we play it, we don't know the
32
35
// current position of it since YouTube doesn't provide such information, so assume duration is unknown.
33
36
durationValue = 0 ;
34
37
}
35
38
36
39
return new TemporalInfo (
37
- ( isLive || hasLivestreamability ) && durationValue == 0 ,
40
+ isLive ,
38
41
durationValue == 0 ? DURATION_MS_UNKNOWN : Units .secondsToMillis (durationValue )
39
42
);
40
43
}
You can’t perform that action at this time.
0 commit comments