String errorString = null; if (e.type == ExoPlaybackException.TYPE_RENDERER) { Exception cause = e.getRendererException(); if (cause instanceof DecoderInitializationException) {
@Override public void onPlayerError(ExoPlaybackException error) { currentStream = null; Exception exception; switch (error.type) { case ExoPlaybackException.TYPE_RENDERER: exception = error.getRendererException(); break; case ExoPlaybackException.TYPE_SOURCE: exception = error.getSourceException(); break; case ExoPlaybackException.TYPE_UNEXPECTED: exception = error.getUnexpectedException(); break; default: return; } exception.printStackTrace(); Toast.makeText(this, exception.getClass().getName() + ": " + exception.getMessage(), Toast.LENGTH_SHORT).show(); }
@Override public void onPlayerError(ExoPlaybackException error) { final String what; switch (error.type) { case ExoPlaybackException.TYPE_SOURCE: what = error.getSourceException().getMessage(); break; case ExoPlaybackException.TYPE_RENDERER: what = error.getRendererException().getMessage(); break; case ExoPlaybackException.TYPE_UNEXPECTED: what = error.getUnexpectedException().getMessage(); break; default: what = "Unknown: " + error; } if (mCallback != null) { mCallback.onError("ExoPlayer error " + what); } }
@Override public void onPlayerError(ExoPlaybackException error) { switch (error.type) { case TYPE_RENDERER: // error occurred in a Renderer LogHelper.e(LOG_TAG, "An error occurred. Type RENDERER: " + error.getRendererException().toString()); break; case TYPE_SOURCE: // error occurred loading data from a MediaSource. LogHelper.e(LOG_TAG, "An error occurred. Type SOURCE: " + error.getSourceException().toString()); break; case TYPE_UNEXPECTED: // error was an unexpected RuntimeException. LogHelper.e(LOG_TAG, "An error occurred. Type UNEXPECTED: " + error.getUnexpectedException().toString()); break; default: LogHelper.w(LOG_TAG, "An error occurred. Type OTHER ERROR."); break; } }
public static NoPlayer.PlayerError errorFor(ExoPlaybackException exception) { String message = ErrorFormatter.formatMessage(exception.getCause()); switch (exception.type) { case ExoPlaybackException.TYPE_SOURCE: return SourceErrorMapper.map(exception.getSourceException(), message); case ExoPlaybackException.TYPE_RENDERER: return RendererErrorMapper.map(exception.getRendererException(), message); case ExoPlaybackException.TYPE_UNEXPECTED: return UnexpectedErrorMapper.map(exception.getUnexpectedException(), message); default: return new NoPlayerError(PlayerErrorType.UNKNOWN, DetailErrorType.UNKNOWN, message); } } }