Skip to content

Commit cbd3308

Browse files
committed
Ensure that progressive contents are URL contents for playback
A ResolverException will be now thrown otherwise.
1 parent 0ad6b3b commit cbd3308

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/src/main/java/org/schabi/newpipe/player/resolver/PlaybackResolver.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@ private static ProgressiveMediaSource buildProgressiveMediaSource(
249249
final Stream stream,
250250
final String cacheKey,
251251
final MediaItemTag metadata) throws ResolverException {
252+
if (!stream.isUrl()) {
253+
throw new ResolverException("Non URI progressive contents are not supported");
254+
}
252255
throwResolverExceptionIfUrlNullOrEmpty(stream.getContent());
253256
return dataSource.getProgressiveMediaSourceFactory().createMediaSource(
254257
new MediaItem.Builder()
@@ -503,9 +506,9 @@ private static Uri manifestUrlToUri(final String manifestUrl) {
503506
private static void throwResolverExceptionIfUrlNullOrEmpty(@Nullable final String url)
504507
throws ResolverException {
505508
if (url == null) {
506-
throw new ResolverException("Null stream url");
509+
throw new ResolverException("Null stream URL");
507510
} else if (url.isEmpty()) {
508-
throw new ResolverException("Empty stream url");
511+
throw new ResolverException("Empty stream URL");
509512
}
510513
}
511514
//endregion

0 commit comments

Comments
 (0)