3

I just want to stream video in android app, I tried following approachs:
1) Using VideoView and setting setVideoURI(vidUri):
Problem: Works fine for small videos but starts stuttering for large videos and request for range headers multiple times.

2) Custom Progressive Streaming with MediaPlayer as suggested by biosopher in his Link
For audio file it works perfectly fine but it doesn't work for video files.

Here i changed a bit like using VideoView instead of media player and playing from buffered file.
I am parallelly downloading a video into a file and playing it using videoview from another file, i am transferring the content as and when it is required.
Problem:The content which gets donwloaded but is not understood by VideoView as it says Unable to create media player,Unable to open content or Error initializing the MediaPlayer while using setDataSoure
Even i verfied the downloaded video file by playing it in windows media player, it was unable to play that video, so i assume the content was wrongly downloaded.

So can anyone provide the solution to stream a video progressively(play and download parallelly) with VideoView or MediaPlayer in android?

Mahantesh M Ambi
  • 786
  • 1
  • 13
  • 25
  • What did you end up doing ? – coding_idiot Mar 20 '17 at 11:50
  • @coding_idiot : I stopped working on that, but after many years when i see my question again, i can only conclude that we decode the videos and write raw buffer from server onto to the outputstream, so while playing or writing onto to container(mp4) in android client, we should encode it into specific format. Then only any video player can decode back and play from the file. Now i might give it a try after few months, but if you find this approach working then please do answer here. – Mahantesh M Ambi Mar 24 '17 at 11:29

0 Answers0