Hello, I'm trying to play a video through SurfaceView + mediaplayer. On version 23 android everything works fine. But if the version is below 23, it gives an error:

E / MediaPlayer: Should have subtitle controller already set

E / MediaPlayer: error (1, -38)

In the code, everything is fine. On api 23 it works fine.

The videos are different. Here on what I test .

In this case, there are videos that are played (low-quality mp4), but there are not working. An application for Android TV (I think it is not particularly important).

I tried using ExoPlayer:

I / VideoCapabilities: Unsupported profile 4 for video / mp4v-es

I / OMXClient: Using client-side OMX mux.

W / OMXNodeInstance: [1: google.h264.decoder] component does not support metadata mode; using fallback

E / ACodec: [OMX.google.h264.decoder] storeMetaDataInBuffers failed w / err -1010

I / OMXClient: Using client-side OMX mux.

E / SoftAVC: Decoder failed: -2

E / ACodec: [OMX.google.h264.decoder] ERROR (0x80001001)

E / ACodec: signalError (omxError 0x80001001, internalError -2147483648)

E / MediaCodec: Codec reported err 0x80001001, actionCode 0, while in state 6

For clarity, the code

private void setupVideoView() { emVideoView = (EMVideoView)findViewById(R.id.video_view); emVideoView.setOnPreparedListener(this); emVideoView.setVideoPath(FILE_PATH); } @Override public void onPrepared() { emVideoView.start(); } 

In both cases, black screen instead of video. How can I fix this?

    1 answer 1

    This question has already been asked

    As I understand it, you need to add a line: mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);

    Just in case, here is an example from the docks.