Android tv app is crashing while playing video

115 views Asked by At

I have built a carousel app for android tv, which shows images and plays videos. But recently it started crashing once the video starts playing. I have tested this on a mobile device it's working fine working fine. Errors I got -
E/MediaPlayer: error (1, -2147479552)
E/MediaPlayer: error (1, -38)
E/MediaPlayer: Error (1,-2147479552)
E/MediaPlayer: Error (1,-38)
E/MediaPlayer: stop called in state 0, mPlayer(0xd317c860)
E/MediaPlayer: error (-38, 0)

[![enter image description here][1]][1] [1]: https://i.stack.imgur.com/6mkaB.png

Test Device Info :

  • X96mini media box
  • Android Version 7.1.2
2

There are 2 answers

0
Ganesh Shetty On BEST ANSWER

Once video playback completed, call stopPlayback() method. it's working fine now.

videoView.setOnCompletionListener(mp -> { videoView.stopPlayback();} )
0
JUNIT On

Did you invoke stop() API as soon as created the player instance? If you update the SDK and it was called the stop in a idle state of player then it would be got the error.

https://developer.android.com/reference/android/media/MediaPlayer#Valid_and_Invalid_States