In reach media mobile applications, we are often required to play videos from a remote source. PhoneGap can play remote videos by two ways: a plugin or a web API. The simpler way is by using a web API.
Playing a video using PhoneGap can be done by using the HTML5 video
tag:
Firstly, create a new PhoneGap project named
remotevideo
by running this command:phonegap create remotevideo com.myapp.remotevideo remotevideo
Add the devices platform. You can choose to use Android, iOS, or both:
cordova platform add ios cordova platform add android
Open
www/index.html
. Let's clean up the unnecessary elements. So, we have the following code:<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="format-detection" content="telephone=no" /> <meta name="msapplication-tap-highlight" content="no" /> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum...