Currently using PHONEGAP development of mobile phone applications, rarely involved in video playback functions, the main reason is that the PHONEGAP provides the API to support the video playback function is not enough, of course, play audio generally still can be achieved, due to work needs, I have studied how to use PhoneGap to develop video playback software, mainly has the following several ideas:
Solution 1: Use the video tag in HTML5 to play, which actually behaves in phonegap and is tested directly with the Android native browser, and you will find that a page with the video tag placed on the server is opened with the Android native browser , for HLS address video loading speed is very slow, this is obviously not possible, the reason, or the HLS protocol is Apple proposed, Android to its support is not enough, so the use of video tags in the PhoneGap Android platform to play HLS is obviously not reliable;
Solution 2:phonegap provides a plug-in mechanism that allows developers to call Android native functionality and other apps in the phone with Java code, which gives us a way of thinking, in fact, as long as you are familiar with PHONEGAP plug-in development, You will find that native Android has developed features that can be implemented using PHONEGAP, because the functionality that PhoneGap cannot implement, we can still use Java code to implement, The app is actually a hybrid app. In this way, we can develop a video playback plug-in, call the phone has been installed in the player to play the video, here is someone else to write the Videoplayer plugin, do not need to write our own, the address is as follows: HTTPS ://github.com/raulduran/videoplayer, after testing, found that QQ browser comes with video playback software to play HLS effect is the most ideal, so need to download a QQ browser and installed on the phone;
Solution 3: Own the development of the player, this solution due to the cycle is too long, and need a lot of native Android development and video playback knowledge of the reserves, in the current situation has not been considered, but with the progress of the subsequent work must do this step, the current idea is to use Vitamio to do, the official website address is: HTTPS ://www.vitamio.org/.
Summary: The above is mainly about how to use PhoneGap on the Android platform to develop HLS playback software solutions, under the iOS platforms, using the HTML5 video tag can be, Because the WebView class in Apple's SDK supports video to play HLS (its own protocol, of course, gives good support on its own product).