Commit ebe138fa authored by vengadesh's avatar vengadesh Committed by Matt Apperson
Browse files

Raising error for source exception (#799)

parent 6e437010
Loading
Loading
Loading
Loading
+6 −1
Changes for android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -482,6 +482,7 @@ class ReactExoplayerView extends FrameLayout implements
    @Override
    public void onPlayerError(ExoPlaybackException e) {
        String errorString = null;
        Exception ex = e;
        if (e.type == ExoPlaybackException.TYPE_RENDERER) {
            Exception cause = e.getRendererException();
            if (cause instanceof MediaCodecRenderer.DecoderInitializationException) {
@@ -504,8 +505,12 @@ class ReactExoplayerView extends FrameLayout implements
                }
            }
        }
        else if (e.type == ExoPlaybackException.TYPE_SOURCE) {
            ex = e.getSourceException();
            errorString = getResources().getString(R.string.unrecognized_media_format);
        }
        if (errorString != null) {
            eventEmitter.error(errorString, e);
            eventEmitter.error(errorString, ex);
        }
        playerNeedsSource = true;
        if (isBehindLiveWindow(e)) {
+2 −0
Changes for android-exoplayer/src/main/res/values/strings.xml: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -9,4 +9,6 @@

  <string name="error_instantiating_decoder">Unable to instantiate decoder <xliff:g id="decoder_name">%1$s</xliff:g></string>

  <string name="unrecognized_media_format">Unrecognized media format</string>

</resources>