Android Studio Simpleexoplayer ERROR_CODE_DECODER_INIT_FAILED

Hasper Ong
Aug 1, 2023

--

Using simpleexoplayer without release will hit this error ERROR_CODE_DECODER_INIT_FAILED

MediaCodecVideoRenderer error, index=0, format=Format(0, null, null, video/avc, avc1.42C01E, 3307000, null, [480, 270, -1.0], [-1, -1]), format_supported=YES

Override
protected void onDestroy() {
releasePlayer();
super.onDestroy();
}

private void releasePlayer() {
if (player != null) {
player.stop();
player.release();
player = null;
}
}

Every simpleexoplayer play from one activity to another activity need to stop, release and set to null before start a new play from simplexoplayer.

--

--

Hasper Ong

i am mobile developer, i love to share story, and of course i love to write story.