|
|
|
|
@ -22,6 +22,7 @@ import androidx.media3.common.C; |
|
|
|
|
import androidx.media3.common.PlaybackException; |
|
|
|
|
import androidx.media3.common.Player; |
|
|
|
|
import androidx.media3.exoplayer.ExoPlayer; |
|
|
|
|
import androidx.media3.exoplayer.drm.FrameworkMediaDrm; |
|
|
|
|
import androidx.media3.exoplayer.util.EventLogger; |
|
|
|
|
import androidx.media3.ui.PlayerView; |
|
|
|
|
|
|
|
|
|
@ -343,6 +344,8 @@ public class Players implements Player.Listener, ParseCallback { |
|
|
|
|
startParse(channel.result(), false); |
|
|
|
|
} else if (isIllegal(channel.getUrl())) { |
|
|
|
|
ErrorEvent.url(); |
|
|
|
|
} else if (channel.getDrm() != null && !FrameworkMediaDrm.isCryptoSchemeSupported(channel.getDrm().getUUID())) { |
|
|
|
|
ErrorEvent.drm(); |
|
|
|
|
} else { |
|
|
|
|
setMediaItem(channel, timeout); |
|
|
|
|
} |
|
|
|
|
@ -355,6 +358,8 @@ public class Players implements Player.Listener, ParseCallback { |
|
|
|
|
startParse(result, useParse); |
|
|
|
|
} else if (isIllegal(result.getRealUrl())) { |
|
|
|
|
ErrorEvent.url(); |
|
|
|
|
} else if (result.getDrm() != null && !FrameworkMediaDrm.isCryptoSchemeSupported(result.getDrm().getUUID())) { |
|
|
|
|
ErrorEvent.drm(); |
|
|
|
|
} else { |
|
|
|
|
setMediaItem(result, timeout); |
|
|
|
|
} |
|
|
|
|
@ -404,7 +409,7 @@ public class Players implements Player.Listener, ParseCallback { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setMediaItem(Map<String, String> headers, String url, String format, Drm drm, List<Sub> subs, int timeout) { |
|
|
|
|
if (exoPlayer != null) exoPlayer.setMediaItem(ExoUtil.getMediaItem(this.headers = checkUa(headers), UrlUtil.uri(this.url = url), this.format = format, this.drm = drm, checkSub(this.subs = subs), decode), position); |
|
|
|
|
if (exoPlayer != null) exoPlayer.setMediaItem(ExoUtil.getMediaItem(this.headers = checkUa(headers), UrlUtil.uri(this.url = url), this.format = format, this.drm = drm, checkSub(this.subs = subs)), position); |
|
|
|
|
if (exoPlayer != null) exoPlayer.prepare(); |
|
|
|
|
App.post(runnable, timeout); |
|
|
|
|
session.setActive(true); |
|
|
|
|
|