Giter Site home page Giter Site logo

aksrustagi / react-native-native-video-player Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bondgoat/react-native-native-video-player

0.0 0.0 0.0 61 KB

React native video player, used for Android, iOS. It will lauch a Native Video, not an Embeded Component

License: GNU General Public License v3.0

Java 52.12% JavaScript 13.76% Objective-C 34.12%

react-native-native-video-player's Introduction

react-native-native-video-player

React native video player component, used for Android, iOS

Table of contents

Install

npm install react-native-native-video-player --save

Link

react-native link react-native-native-video-player

OR

Use rnpm to automatically complete the installation:
rnpm link react-native-native-video-player

or link manually like so:

iOS

  • Add RNVideoPlayer in ios folder to your ios project
  • Open 'node_modules/react-native-native-video-player/ios/RNVideoPlayer.xcodeproj' with Xcode
  • Go to Build Settings > Search Paths > Header Search Paths
  • Edit the path variable from $(SRCROOT)/../../../HuntersLog to $(SRCROOT)/../../../[YOUR PROJECT FOLDER NAME]

Android

In case you're using React Native version > 0.45.0, please remove @Override of createJSModule() in VideoPlayerPackage.java

// file: android/app/src/main/java/com/wog.videoplayer.VideoPlayerPackage.java
...
	  @Override // remove this if RN > 0.45.0
      public List<Class<? extends JavaScriptModule>> createJSModules() {
          return Collections.emptyList();
      }
// file: android/settings.gradle
...

include ':react-native-native-video-player'
project(':react-native-native-video-player').projectDir = new File(settingsDir, '../node_modules/react-native-native-video-player/android')
// file: android/app/build.gradle
...

dependencies {
    ...
    compile project(':react-native-native-video-player')
}
// file: android/app/src/main/java/com/<...>/MainApplication.java
...

import com.wog.videoplayer.VideoPlayerPackage; // <-- add this import

public class MainApplication extends Application implements ReactApplication {
    @Override
    protected List<ReactPackage> getPackages() {
        return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            new VideoPlayerPackage() // <-- add this line
        );
    }
...
}

Usage

var VideoPlayer = require('react-native-native-video-player');

/**
 * The method will launch native module
 * @param {String} url Video link
 */
VideoPlayer.showVideoPlayer(url);

react-native-native-video-player's People

Contributors

bondgoat avatar matiasfha avatar areeb111 avatar jmoutte avatar bondgnguyen avatar psrustik 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.