Ganesh Shetty
Ganesh Shetty

Reputation: 322

Android tv app is crashing while playing video

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.sstatic.net/6mkaB.png

Test Device Info :

Upvotes: 0

Views: 177

Answers (2)

Ganesh Shetty
Ganesh Shetty

Reputation: 322

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

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

Upvotes: 0

JUNIT
JUNIT

Reputation: 11

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

Upvotes: 1

Related Questions