For iOS and Android, remake of Nicholas Hutchind
This plugin allows you to stream video in a fullscreen, native player on iOS and Android.
- 1.0.1+ Works with Cordova >= 4.0
cordova plugin add https://github.com/dan-leech/com.danleech.cordova.plugin.videoplayer
To remove
cordova plugin remove com.danleech.cordova.plugin.videoplayer
- Uses the AVPlayerViewController, supported for iOS 9+.
- Tested on iOS 11
- Uses ExoPlayer2 (com.google.android.exoplayer:exoplayer:2.8.2).
- Creates two activities in your AndroidManifest.xml file.
- Tested on Android 4.0+
var videoUrl = STREAMING_VIDEO_URL;
// Just play a video
window.plugins.VideoPlayer.play(videoUrl);
// Play a video with callbacks
var options = {
successCallback: function() {
console.log("Video was closed without error.");
},
errorCallback: function(errMsg) {
console.log("Error! " + errMsg);
},
orientation: 'landscape',
shouldAutoClose: true, // true(default)/false
controls: true // true(default)/false. Used to hide controls on fullscreen
};
window.plugins.VideoPlayer.play(videoUrl, options);