Reputation: 455
I am creating an application that would fetch the videos stored on FTP server. I am providing the options to play the videos online using Android Videoview explained in below link. My problem is that I want user to select which quality he prefers to watch video in i.e. Low or High quality, on selecting Low quality the video quality should decrease while playing the video (in case of HD video). Does anyone have an idea on how to achieve it.
Referred link to watch videos using Android Videoview: http://www.androidbegin.com/tutorial/android-video-streaming-videoview-tutorial/
Upvotes: 1
Views: 1312
Reputation: 25491
It sounds like you are describing adaptive bit rate streaming where the client player continuously selects from a number of available video streams depending on the connection speed to ensure continuous playback without stopping for buffering.
This is possible because the source video is encoded in multiple bit rates and chunked into equal time size chunks in each stream. Hence the player can choose the most appropriate next chunk at any point in time, depending on the bandwidth at that time.
Many players, including YoutTube's player, will allow the user override this and manually select the bit rate they want from those available (have a look at the quality setting under the setting button on a typical YouTube video).
Unfortunately, Android as standard is not very good at supporting adaptive bit rate streams. These streams were traditionally HLS and you can see some of the issues with HLS that many users find:
There does not appear to be any universally accepted open source and free Android video player library which supports HLS at this time - it may be that the emerging MPEG-DASH (a sort of industry standard version of HLS) will become dominant and have better Android support, although this may still mean the stream provider must support both HLS (for iOS devices) and MPEG-DASH for other devices.
For your case if you will just have two separate video file on your server you may be ok with a simpler solution, just asking the user to choose one or the other up front and then using the URL of the appropriate one for the duration of the video.
Upvotes: 1