dan-leech / com.danleech.cordova.plugin.videoplayer

Simple plugin for loading full screen streaming video in native video player

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cordova Video Player plugin

For iOS and Android, remake of Nicholas Hutchind

Description

This plugin allows you to stream video in a fullscreen, native player on iOS and Android.

  • 1.0.1+ Works with Cordova >= 4.0

Installation

cordova plugin add https://github.com/dan-leech/com.danleech.cordova.plugin.videoplayer

To remove

cordova plugin remove com.danleech.cordova.plugin.videoplayer

iOS specifics

  • Uses the AVPlayerViewController, supported for iOS 9+.
  • Tested on iOS 11

Android specifics

  • Uses ExoPlayer2 (com.google.android.exoplayer:exoplayer:2.8.2).
  • Creates two activities in your AndroidManifest.xml file.
  • Tested on Android 4.0+

Usage

  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);

Special Thanks

Nicholas Hutchind

Michael Robinson (@faceleg)

Timothy Shamilov (@shamilovtim)

About

Simple plugin for loading full screen streaming video in native video player

License:MIT License


Languages

Language:Java 63.5%Language:Objective-C 34.0%Language:JavaScript 2.5%