private void notifyAndThrowDecoderInitError(DecoderInitializationException e) throws ExoPlaybackException { notifyDecoderInitializationError(e); throw new ExoPlaybackException(e); }
@Override public void onPlayerError(ExoPlaybackException error) { // Check if there is an error setting PlaybackParams if (error.getCause() instanceof IllegalArgumentException && error.getCause().getStackTrace()[0].getMethodName() .equals("native_set_playback_params")) { // Make sure the error is related to PlaybackParams if (playbackParams != null && Math.abs(playbackParams.getSpeed() - 1f) > 0.1) { if (fakeTrickplayRunnable == null) { fakeTrickplayRunnable = new FakeTrickplayRunnable(DemoPlayer.this); } fakeTrickplayRunnable.setPlaybackParams(playbackParams); prepare(); play(); } } } };
@Override public void onPlayerError(ExoPlaybackException error) { WritableMap params = Arguments.createMap(); params.putString("msg", error.getMessage()); sendEvent("error", params); } }
private void maybeThrowError(SampleSourceReader source) throws ExoPlaybackException { try { source.maybeThrowError(); } catch (IOException e) { throw new ExoPlaybackException(e); } }
private boolean shouldWaitForKeys(boolean sampleEncrypted) throws ExoPlaybackException { if (!openedDrmSession) { return false; } int drmManagerState = drmSessionManager.getState(); if (drmManagerState == DrmSessionManager.STATE_ERROR) { throw new ExoPlaybackException(drmSessionManager.getError()); } if (drmManagerState != DrmSessionManager.STATE_OPENED_WITH_KEYS && (sampleEncrypted || !playClearSamplesWithoutKeys)) { return true; } return false; }
@Override protected void doSomeWork(long positionUs, long elapsedRealtimeUs) throws ExoPlaybackException { continueBufferingSource(positionUs); if (!inputStreamEnded && pendingMetadata == null) { int result = readSource(positionUs, formatHolder, sampleHolder, false); if (result == SampleSource.SAMPLE_READ) { pendingMetadataTimestamp = sampleHolder.timeUs; try { pendingMetadata = metadataParser.parse(sampleHolder.data.array(), sampleHolder.size); } catch (IOException e) { throw new ExoPlaybackException(e); } sampleHolder.data.clear(); } else if (result == SampleSource.END_OF_STREAM) { inputStreamEnded = true; } } if (pendingMetadata != null && pendingMetadataTimestamp <= positionUs) { invokeRenderer(pendingMetadata); pendingMetadata = null; } }
} catch (RuntimeException e) { Log.e(TAG, "Internal runtime error.", e); eventHandler.obtainMessage(MSG_ERROR, new ExoPlaybackException(e, true)).sendToTarget(); stopInternal(); return true;
throw new ExoPlaybackException(e); } catch (CryptoException e) { notifyCryptoError(e); throw new ExoPlaybackException(e);
throw new ExoPlaybackException(e); } catch (AudioTrack.WriteException e) { notifyAudioTrackWriteError(e); throw new ExoPlaybackException(e);
if (drmInitData != null) { if (drmSessionManager == null) { throw new ExoPlaybackException("Media requires a DrmSessionManager"); throw new ExoPlaybackException(drmSessionManager.getError()); } else if (drmSessionState == DrmSessionManager.STATE_OPENED || drmSessionState == DrmSessionManager.STATE_OPENED_WITH_KEYS) {
nextSubtitle = parserHelper.getAndClearResult(); } catch (IOException e) { throw new ExoPlaybackException(e);