1

I am trying to play .m3u8 HLS stream in android.Its working fine.To check the adaptive bitrate streaming,i am switching the network while playing the video.I am connecting wifi and 3G.The Video starts playing in WIFI.And when I switch-off the WIFI,the player plays the video till the end of buffered data and gets dismissed.

My question is

  • Why the player is not taking the second connection and continue the streaming ?
  • How to hadle this scenario in android side?

Immediate help would be appreciated.

Karthi
  • 125
  • 2
  • 11
  • Have you tried the [VLC player](https://play.google.com/store/apps/details?id=org.videolan.vlc.betav7neon&hl=en) in the same scenario? – Alex Cohn Mar 11 '15 at 10:20
  • Hey,here i using encrypted video(forget to mention this).I have given the same video url in vlc which i am using in the app,it not even loading the video. – Karthi Mar 11 '15 at 10:53
  • Maybe, the encryption is also the cause that the streaming is cut when you switch data connection? – Alex Cohn Mar 11 '15 at 12:18
  • What do you mean by player getting dismissed? A workaround this problem that I use it myself is to register OnErrorListener. Media player if unable to load will call onError() callback and there you can retry i.e. load media again and seekTo last playing position to resume from where you left off. – AllThatICode Jul 01 '15 at 13:35

1 Answers1

0

You have multiple variables in this problem. Whether the HLS Playback is the issue or Encrypted video is the issue, or Switching network itself is the issue. So first, 1. Play a youtube video in WiFi and switch off the wifi router to see the video continue to playback even after the buffer. (Pick a longer video and enough playback to really make sure the buffer was over and is still playing. OR check the network logs to be 100% sure) If that works fine, then we know network switching is not the issue. 2. If the Step 1 is passed, check a non encrypted video on your player and test the same. (Ex. "http://edu.infozen.cshls.lldns.net/infozen/edu/edu.m3u8") 3. If the step 2 is failed, it could be your player. 4. If the step 2 is passed, check whether you are using a standard aes encryption or any type of DRM which may stop streaming in such as change. For all this, a network capture tool is a great way to proceed. It can tell you whether the requests are made or not. If made whether it is success or not. (Charles Proxy and Fiddler are simple tools. You may use wireshark as well)

Dvyz
  • 479
  • 4
  • 9