fix crash from null value
This commit is contained in:
parent
dc3b89c380
commit
9560b2d4cb
1 changed files with 4 additions and 1 deletions
|
|
@ -189,8 +189,11 @@ public class MultiPlayer implements Playback {
|
||||||
@Override
|
@Override
|
||||||
@EverythingIsNonNull
|
@EverythingIsNonNull
|
||||||
public void onResponse(Call call, Response response) {
|
public void onResponse(Call call, Response response) {
|
||||||
|
String type = response.header("Content-Type");
|
||||||
|
if (type == null) return;
|
||||||
|
|
||||||
MediaSource source;
|
MediaSource source;
|
||||||
if (response.header("Content-Type").equals("application/x-mpegURL")) {
|
if (type.equals("application/x-mpegURL")) {
|
||||||
source = new HlsMediaSource.Factory(dataSource)
|
source = new HlsMediaSource.Factory(dataSource)
|
||||||
.setTag(path)
|
.setTag(path)
|
||||||
.setAllowChunklessPreparation(true)
|
.setAllowChunklessPreparation(true)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue