24

For video view in Android, I have added some media player listener such as onPreparedListener, onCompletionListener etc. But when video get completed then onCompletionListener is not getting called. Also we observe that something onCompletionListener get called and sometime not.

This issue occurs only for Samsung Galaxy tablet OS version 4.1.2. And the same code had worked properly on another Samsung device such as S2, S3, S4 etc.

Does anyone have ideas?

Downgoat
  • 13,771
  • 5
  • 46
  • 69
user2526886
  • 349
  • 2
  • 2

2 Answers2

1

Two comments.

  1. To check whether the VideoView causes the issue. because the OnCompletionListener interface of VideoView is just a wrap for the MediaPlayer's OnCompletionListener interface, you can use a MediaPlayer directly to play the video file and check whether its OnCompletionListener works every time.

    -if the same thing happens, means MediaPlayer can't play the video file correctly, maybe you need check the onError() callback thoroughly.

  2. check whether the video file or Uri points to a corrupted video file, you can use the tools like mp4dump to dump the file information.

Hope it helps.

Khamill
  • 51
  • 7
Zephyr
  • 6,123
  • 34
  • 33
0

I'm not sure but Just a trick which might solve your problem: find the total length of video and check if current position reached. if condition satisfies, copy code of onCompletion here.

A_rmas
  • 784
  • 2
  • 10
  • 26