fix crash from null value

This commit is contained in:
dkanada 2020-11-21 21:18:27 +09:00
commit 9560b2d4cb

View file

@ -189,8 +189,11 @@ public class MultiPlayer implements Playback {
@Override
@EverythingIsNonNull
public void onResponse(Call call, Response response) {
String type = response.header("Content-Type");
if (type == null) return;
MediaSource source;
if (response.header("Content-Type").equals("application/x-mpegURL")) {
if (type.equals("application/x-mpegURL")) {
source = new HlsMediaSource.Factory(dataSource)
.setTag(path)
.setAllowChunklessPreparation(true)