CDVVideo is a Cordova 1.7+ plugin for iOS that allows playing video (local or remote) via a native video player. It is essentially a port of eiffelqiu's phonegape-videoplayer-plugin.
- Drop the
.h
and.m
files into the CordovaPlugins
folder. Use the default options. - Add an entry to the
Plugins
dictionary inCordova.plist
. The key should beCDVVideo
and the value must beCDVVideo
. - Add the
CDVVideo.js
file somewhere under yourwww
directory and include it in yourindex.html
file. - Play a video by calling
CDVVideo.play(video, portrait)
, wherevideo
is the URL or filename you wish to play andportrait
is a string that is eitherYES
orNO
, indicating whether portrait or landscape orientation should be used. - Optional: Change or overwrite
CDVVideo.finished(video)
to handle when a video finishes playing.video
corresponds to the video that you passed toCDVVideo.play()
.