Skip to content

Commit

Permalink
[Peertube] No special handling of live video streams, use ``getHlsMas…
Browse files Browse the repository at this point in the history
…terPlaylistUrl()`` instead
  • Loading branch information
litetex committed Jun 24, 2022
1 parent b66323d commit 48a9fd3
Showing 1 changed file with 0 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,6 @@ private void tryExtractStreams() throws ParsingException {
audioStreams = new ArrayList<>();
videoStreams = new ArrayList<>();

if (isLive()) {
extractLiveVideoStreams();
return;
}

// Progressive streams
try {
addStreamsFromArray(
Expand All @@ -456,28 +451,6 @@ private void tryExtractStreams() throws ParsingException {
}
}

private void extractLiveVideoStreams() throws ParsingException {
try {
json.getArray(STREAMING_PLAYLISTS)
.stream()
.filter(JsonObject.class::isInstance)
.map(JsonObject.class::cast)
// TODO Check! This is the master playlist!
.map(s -> new SimpleVideoAudioStreamImpl(
VideoAudioFormatRegistry.MPEG_4,
new SimpleHLSDeliveryDataImpl(s.getString(PLAYLIST_URL, "")))
)
// Don't use the containsSimilarStream method because it will always
// return
// false so if there are multiples HLS URLs returned, only the first
// will be
// extracted in this case.
.forEachOrdered(videoStreams::add);
} catch (final Exception e) {
throw new ParsingException("Could not get video streams", e);
}
}

private void addStreamsFromArray(
@Nonnull final JsonArray streams,
final String playlistUrl
Expand Down

0 comments on commit 48a9fd3

Please sign in to comment.