Tabnine Logo
com.novoda.noplayer.internal.exoplayer.error
Code IndexAdd Tabnine to your IDE (free)

How to use com.novoda.noplayer.internal.exoplayer.error

Best Java code snippets using com.novoda.noplayer.internal.exoplayer.error (Showing top 8 results out of 315)

origin: novoda/no-player

  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);
    }
  }
}
origin: novoda/no-player

@Override
public void onPlayerError(ExoPlaybackException error) {
  NoPlayer.PlayerError playerError = ExoPlayerErrorMapper.errorFor(error);
  errorListener.onError(playerError);
}
origin: novoda/no-player

@Test
public void givenThrowable_whenFormattingMessage_thenReturnsExpectedMessageFormat() {
  String expectedFormat = "com.novoda.noplayer.internal.exoplayer.error.ErrorFormatterTest$IncorrectFormatThrowable: message";
  String actualFormat = ErrorFormatter.formatMessage(new IncorrectFormatThrowable(MESSAGE));
  assertThat(actualFormat).isEqualTo(expectedFormat);
}
origin: novoda/no-player

return mapAdsError((AdsMediaSource.AdLoadException) sourceException, message);
return mapClippingError((ClippingMediaSource.IllegalClippingException) sourceException, message);
return mapHttpDataSourceException((HttpDataSource.HttpDataSourceException) sourceException, message);
origin: novoda/no-player

  static NoPlayer.PlayerError map(RuntimeException unexpectedException, String message) {
    if (unexpectedException instanceof EGLSurfaceTexture.GlException) {
      return new NoPlayerError(PlayerErrorType.UNEXPECTED, DetailErrorType.EGL_OPERATION_ERROR, message);
    }

    if (unexpectedException instanceof DefaultAudioSink.InvalidAudioTrackTimestampException) {
      return new NoPlayerError(PlayerErrorType.UNEXPECTED, DetailErrorType.SPURIOUS_AUDIO_TRACK_TIMESTAMP_ERROR, message);
    }

    if (unexpectedException instanceof IllegalStateException && message.contains("Multiple renderer media clocks")) {
      return new NoPlayerError(PlayerErrorType.UNEXPECTED, DetailErrorType.MULTIPLE_RENDERER_MEDIA_CLOCK_ENABLED_ERROR, message);
    }

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && unexpectedException instanceof MediaCodec.CodecException) {
      String errorMessage = ErrorFormatter.formatCodecException((MediaCodec.CodecException) unexpectedException);
      return new NoPlayerError(PlayerErrorType.UNEXPECTED, DetailErrorType.UNEXPECTED_CODEC_ERROR, errorMessage);
    }

    return new NoPlayerError(PlayerErrorType.UNKNOWN, DetailErrorType.UNKNOWN, message);
  }
}
origin: novoda/no-player

return mapUnsupportedDrmException((UnsupportedDrmException) rendererException, message);
return mapCryptoException((MediaCodec.CryptoException) rendererException, message);
origin: novoda/no-player

  @Test
  public void mapErrors() {
    NoPlayer.PlayerError playerError = ExoPlayerErrorMapper.errorFor(exoPlaybackException);
    assertThat(playerError.type()).isEqualTo(playerErrorType);
    assertThat(playerError.detailType()).isEqualTo(detailErrorType);
  }
}
origin: novoda/no-player

@Test
public void givenMediaCodecException_whenFormattingMessage_thenReturnsExpectedMessageFormat() {
  MediaCodec.CodecException codecException = mock(MediaCodec.CodecException.class);
  given(codecException.getDiagnosticInfo()).willReturn("android.media.MediaCodec.error_+1234");
  given(codecException.isTransient()).willReturn(true);
  given(codecException.isRecoverable()).willReturn(false);
  String expectedFormat = "diagnosticInformation=android.media.MediaCodec.error_+1234 : isTransient=true : isRecoverable=false";
  String actualFormat = ErrorFormatter.formatCodecException(codecException);
  assertThat(actualFormat).isEqualTo(expectedFormat);
}
com.novoda.noplayer.internal.exoplayer.error

Most used classes

  • ErrorFormatter
  • ExoPlayerErrorMapper
  • ErrorFormatterTest$IncorrectFormatThrowable
  • RendererErrorMapper
  • SourceErrorMapper
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now