@@ -189,13 +189,16 @@ public static <S extends Stream> List<S> getUrlAndNonTorrentStreams(
189
189
190
190
/**
191
191
* Return a {@link Stream} list which only contains streams which can be played by the player.
192
- * <br>
193
- * Some formats are not supported. For more info, see {@link #SUPPORTED_ITAG_IDS}.
194
- * Torrent streams are also removed, because they cannot be retrieved.
192
+ *
193
+ * <p>
194
+ * Some formats are not supported, see {@link #SUPPORTED_ITAG_IDS} for more details.
195
+ * Torrent streams are also removed, because they cannot be retrieved, like OPUS streams using
196
+ * HLS as their delivery method, since they are not supported by ExoPlayer.
197
+ * </p>
195
198
*
196
199
* @param <S> the item type's class that extends {@link Stream}
197
200
* @param streamList the original stream list
198
- * @param serviceId
201
+ * @param serviceId the service ID from which the streams' list comes from
199
202
* @return a stream list which only contains streams that can be played the player
200
203
*/
201
204
@ NonNull
@@ -204,6 +207,8 @@ public static <S extends Stream> List<S> getPlayableStreams(
204
207
final int youtubeServiceId = YouTube .getServiceId ();
205
208
return getFilteredStreamList (streamList ,
206
209
stream -> stream .getDeliveryMethod () != DeliveryMethod .TORRENT
210
+ && (stream .getDeliveryMethod () != DeliveryMethod .HLS
211
+ || stream .getFormat () != MediaFormat .OPUS )
207
212
&& (serviceId != youtubeServiceId
208
213
|| stream .getItagItem () == null
209
214
|| SUPPORTED_ITAG_IDS .contains (stream .getItagItem ().id )));
@@ -295,7 +300,9 @@ public static List<AudioStream> getFilteredAudioStreams(
295
300
final Comparator <AudioStream > cmp = getAudioFormatComparator (context );
296
301
297
302
for (final AudioStream stream : audioStreams ) {
298
- if (stream .getDeliveryMethod () == DeliveryMethod .TORRENT ) {
303
+ if (stream .getDeliveryMethod () == DeliveryMethod .TORRENT
304
+ || (stream .getDeliveryMethod () == DeliveryMethod .HLS
305
+ && stream .getFormat () == MediaFormat .OPUS )) {
299
306
continue ;
300
307
}
301
308
0 commit comments