Buggy code:
@ SuppressLint ( "ViewConstructor" ) public class VideoMediaView extends MediaView implements MediaPlayer . OnErrorListener , MediaPlayer . OnInfoListener , MediaPlayer . OnPreparedListener , MediaPlayer . OnVideoSizeChangedListener { @ InjectView ( id . video ) private TextureView surfaceView ; @ InjectView ( id . video_container ) private ViewGroup videoContainer ; @ Inject private Settings settings ; private VideoMediaView . State targetState = VideoMediaView . State . IDLE ; private VideoMediaView . State currentState = VideoMediaView . State . IDLE ; private MediaPlayer mediaPlayer ; private VideoMediaView . SurfaceTextureListenerImpl surfaceHolder ; private boolean mediaPlayerHasTexture ; private int retryCount ; public VideoMediaView ( Context context , Binder binder , String url ) { } @ Override public void onResume ( ) { } @ Override public void onPause ( ) { } @ Override public void playMedia ( ) { } @ Override public void stopMedia ( ) { } private void moveTo ( VideoMediaView . State target ) { } private void moveTo_Playing ( ) { } private void setMediaPlayerTexture ( SurfaceTexture texture ) { } private void moveTo_Pause ( ) { } private void moveTo_Idle ( ) { } @ Override public void onPrepared ( MediaPlayer mp ) { } @ Override public void onVideoSizeChanged ( MediaPlayer mp , int width , int height ) { } @ Override public boolean onError ( MediaPlayer mp , int what , int extra ) { moveTo ( VideoMediaView . State . IDLE ) ; final int METHOD_CALLED_IN_INVALID_STATE = - 38 ; if ( ( what == ( MediaPlayer . MEDIA_ERROR_SERVER_DIED ) ) || ( what == METHOD_CALLED_IN_INVALID_STATE ) ) { if ( ( retryCount ) < 3 ) { ( retryCount ) ++ ; if ( isPlaying ( ) ) { postDelayed ( ( ) -> { if ( isPlaying ( ) ) { moveTo ( State . PLAYING ) ; } } , 500 ) ; } return true ; } } String message = String . format ( "Error<seq2seq4repair_space>playing<seq2seq4repair_space>this<seq2seq4repair_space>video<seq2seq4repair_space>(%d,<seq2seq4repair_space>%d)" , what , extra ) ; logger . info ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>play<seq2seq4repair_space>video:<seq2seq4repair_space>" + message ) ) ; try { <START_BUG> if ( ( what == ( MediaPlayer . MEDIA_ERROR_UNSUPPORTED ) ) && ( extra == ( MediaPlayer . MEDIA_ERROR_IO ) ) ) { <END_BUG> new com . afollestad . materialdialogs . MaterialDialog . Builder ( getContext ( ) ) . content ( could_not_play_video_io ) . positiveText ( okay ) . show ( ) ; return true ; } AndroidUtility . logToCrashlytics ( new RuntimeException ( message ) ) ; if ( what == 262 ) { Optional < File > logFile = LogcatUtility . dump ( ) ; if ( logFile . isPresent ( ) ) { new com . afollestad . materialdialogs . MaterialDialog . Builder ( getContext ( ) ) . content ( getContext ( ) . getString ( could_not_play_video_262 , logFile . get ( ) ) ) . positiveText ( okay ) . show ( ) ; return true ; } } new com . afollestad . materialdialogs . MaterialDialog . Builder ( getContext ( ) ) . content ( could_not_play_video ) . positiveText ( okay ) . show ( ) ; } catch ( Exception ignored ) { } return true ; } private void openMediaPlayer ( ) { } @ Override public boolean onInfo ( MediaPlayer mp , int what , int extra ) { } private class SurfaceTextureListenerImpl implements TextureView . SurfaceTextureListener { private SurfaceTexture texture ; @ Override public void onSurfaceTextureAvailable ( SurfaceTexture surface , int width , int height ) { } @ Override public void onSurfaceTextureSizeChanged ( SurfaceTexture surface , int width , int height ) { } @ Override public boolean onSurfaceTextureDestroyed ( SurfaceTexture surface ) { } @ Override public void onSurfaceTextureUpdated ( SurfaceTexture surface ) { } public boolean hasTexture ( ) { } public SurfaceTexture getTexture ( ) { } public void destroyTexture ( ) { } } @ TargetApi ( VERSION_CODES . JELLY_BEAN ) private void tryRestoreTexture ( SurfaceTexture texture ) { } private enum State { IDLE , PREPARING , PAUSED , PLAYING ; public boolean after ( VideoMediaView . State state ) { } } }

Fix:
if ( ( what == ( MediaPlayer . MEDIA_ERROR_UNKNOWN ) ) && ( extra == ( MediaPlayer . MEDIA_ERROR_IO ) ) ) {