@Override public void onNativeCrash() { if (eventHandler != null && eventListener != null) { eventHandler.post(new Runnable() { @Override public void run() { eventListener.onDecoderInitializationError(new DecoderInitializationException(null, new Exception( "VLC Lib native crash occures."), 0)); if (VLCNativeCrashHandler.this.surfacePlayer != null) { VLCNativeCrashHandler.this.surfacePlayer.release(); VLCNativeCrashHandler.this.surfacePlayer = null; } } }); } }
@Override public void onError(Exception e) { String errorString = null; if (e instanceof UnsupportedDrmException) { // Special case DRM failures. UnsupportedDrmException unsupportedDrmException = (UnsupportedDrmException) e; errorString = getString(Util.SDK_INT < 18 ? R.string.error_drm_not_supported : unsupportedDrmException.reason == UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME ? R.string.error_drm_unsupported_scheme : R.string.error_drm_unknown); } else if (e instanceof ExoPlaybackException && e.getCause() instanceof DecoderInitializationException) { // Special case for decoder initialization failures. DecoderInitializationException decoderInitializationException = (DecoderInitializationException) e.getCause(); if (decoderInitializationException.decoderName == null) { if (decoderInitializationException.getCause() instanceof DecoderQueryException) { errorString = getString(R.string.error_querying_decoders); } else if (decoderInitializationException.secureDecoderRequired) { errorString = getString(R.string.error_no_secure_decoder, decoderInitializationException.mimeType); } else { errorString = getString(R.string.error_no_decoder, decoderInitializationException.mimeType); } } else { errorString = getString(R.string.error_instantiating_decoder, decoderInitializationException.decoderName); } } if (errorString != null) { Toast.makeText(getApplicationContext(), errorString, Toast.LENGTH_LONG).show(); } playerNeedsPrepare = true; updateButtonVisibilities(); showControls(); }
@Override public void onError(Exception e) { String errorString = null; if (e instanceof UnsupportedDrmException) { // Special case DRM failures. UnsupportedDrmException unsupportedDrmException = (UnsupportedDrmException) e; errorString = getString(Util.SDK_INT < 18 ? R.string.video_error_drm_not_supported : unsupportedDrmException.reason == UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME ? R.string.video_error_drm_unsupported_scheme : R.string.video_error_drm_unknown); } else if (e instanceof ExoPlaybackException && e.getCause() instanceof DecoderInitializationException) { // Special case for decoder initialization failures. DecoderInitializationException decoderInitializationException = (DecoderInitializationException) e.getCause(); if (decoderInitializationException.decoderName == null) { if (decoderInitializationException.getCause() instanceof DecoderQueryException) { errorString = getString(R.string.video_error_querying_decoders); } else if (decoderInitializationException.secureDecoderRequired) { errorString = getString(R.string.video_error_no_secure_decoder, decoderInitializationException.mimeType); } else { errorString = getString(R.string.video_error_no_decoder, decoderInitializationException.mimeType); } } else { errorString = getString(R.string.video_error_instantiating_decoder, decoderInitializationException.decoderName); } } if (errorString != null) { Toast.makeText(getApplicationContext(), errorString, Toast.LENGTH_LONG).show(); } playerNeedsPrepare = true; showControls(); }
@Override public void eventHardwareAccelerationError() { // TODO Auto-generated method stub ExoVlcUtil.log(this, "Error with hardware acceleration"); release(); notifyDecoderInitializationError(new DecoderInitializationException(null, new RuntimeException( "Error with hardware acceleration"), 0)); }
private void notifyDecoderInitializationError(final DecoderInitializationException e) { handlerPost(new Runnable() { @Override public void run() { eventListener.onDecoderInitializationError(e); } }); }
@Override public void onDecoderInitializationError(DecoderInitializationException e) { if (internalErrorListener != null) { internalErrorListener.onDecoderInitializationError(e); } }
@Override public void onDecoderInitializationError(DecoderInitializationException e) { printInternalError("decoderInitializationError", e); }
@Override public void onDecoderInitializationError(DecoderInitializationException e) { // Do nothing. }
@Override public void onDecoderInitializationError(DecoderInitializationException e) { Log.e(tag, "Decoder initialization error", e); }
@Override public void onDecoderInitializationError(DecoderInitializationException ex) { if (internalErrorListener != null) { internalErrorListener.onDecoderInitializationError(ex); } }