0

I'm playing video from url = http://... /playlist.m3u8

    MediaPlayer mVideoPlayer = new MediaPlayer();
    ...
    mVideoPlayer.setDataSource(getApplicationContext(), url);

all works fine...but after 5 min video stops with error

11-24 17:52:22.519: V/MediaPlayer(2777): message received msg=100, ext1=1, ext2=-1004
11-24 17:52:22.519: E/MediaPlayer(2777): error (1, -1004)
11-24 17:52:22.519: V/MediaPlayer(2777): callback application
11-24 17:52:22.519: V/MediaPlayer(2777): back from callback
11-24 17:52:22.519: E/MediaPlayer(2777): Error (1,-1004)

I found in internet that this happens because http server close connection

How to solve this issue on my side?

NickUnuchek
  • 11,794
  • 12
  • 98
  • 138

2 Answers2

0

looks like you play HLS resource via low network connection or server is busy and you cannot reach it. in this case, android tries to fetch next playlist but fails to connect to server, and after several attempts rises this error.

i think you can simply notify users about bad connection and suggest to reconnect to the server :)

debi
  • 59
  • 3
  • It's not a bad connection, it's because http server close connection(like timeout of conection) , read my question – NickUnuchek Nov 24 '14 at 15:22
0

error (1, -1004) is error fetch m3u8 playlist or it's segment during playback.

dasar
  • 5,321
  • 4
  • 24
  • 36