Git Product home page Git Product logo

dan-leech / com.danleech.cordova.plugin.videoplayer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nchutchind/cordova-plugin-streaming-media

1.0 2.0 0.0 90 KB

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

License: MIT License

Java 63.48% Objective-C 34.03% JavaScript 2.49%
cordova cordova-plugin cordova-ios cordova-android native video-player exoplayer2 avplayerviewcontroller

com.danleech.cordova.plugin.videoplayer's Introduction

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)

com.danleech.cordova.plugin.videoplayer's People

Contributors

bardiakh avatar dan-leech avatar faceleg avatar ihadeed avatar mauricioprado00 avatar nchutchind avatar nimatrueway avatar noman115pk avatar paully21 avatar shamilovtim avatar steffenmllr avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.