Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Playing video in PhoneGap/Cordova-app for iOs and Android

I need to play video in an app that's built on PhoneGap 2.7. Is it possible to make this work for both iOs and Android - covering most of todays Android devices?

Preferably the video file should be played from a local location, so that the video file is actually a part of the app. (And other video files can be downloaded and saved before they are played.)

like image 392
Publicus Avatar asked Aug 29 '13 22:08

Publicus


People also ask

Does Cordova work for iOS?

Cordova iOS is an iOS application library that allows for Cordova-based projects to be built for the iOS Platform.

Is Cordova discontinued?

Apache Cordova Is Retired: Alternatives for Cross Platform Mobile Development in 2022. Future trends of cross-platform mobile development are already starting to emerge, and it appears that Apache Cordova won't be included in the list of frameworks that power hybrid web apps for mobile devices.

Is Cordova a hybrid app?

Cordova is a cross-platform tool used to develop a Hybrid App. Hybrid apps using Cordova are web apps written using HTML, CSS, and any JavaScript framework/library.


2 Answers

You can use HTML5 video tag to playback video inside your application.

The video tag had some quirks when used in Cordova application (especially on Android devices), but its support is much improved in newer versions of Cordova, so make sure you're targeting the latest version.

like image 125
Arun Bertil Avatar answered Sep 28 '22 21:09

Arun Bertil


I know this is an old question, but it still comes up in searches.

For playing video in a Cordova app the best plugin to use, from my research, at this time, is :

https://github.com/nchutchind/cordova-plugin-streaming-media

This plays local or streaming video's in a native player, is configurable, and is up kept up to date.

Note that HTML5 video does have strange quirks on Android version, and on an iPhone (but not an iPad), the video will automatically play in the native iPhone player anyway, making the HTML5 video tag a poor choice IMHO, if you want to have video in your application.

like image 26
kris Avatar answered Sep 28 '22 19:09

kris