Coder Social home page Coder Social logo

react-native-vlc-player's Introduction

react-native-vlc-player

A <VLCPlayer> component for react-native

Based on react-native-vlcplayer from xiongchuan86 and on react-native-vlc-player from ghondar

Add it to your project

Run npm i -S https://github.com/kikill95/react-native-vlc-player.git

iOS

  • add pod 'MobileVLCKit-unstable', '3.0.0a44' in Podfile (stable version of VLCKit not working in iOS 11 yet)
  • pod install inside ./ios/ folder
  • rnpm link react-native-vlc-player
  • also you must disable bitcode option in target build settings (otherwise it not linked correctly for armv7)
  • also you must add libstdc++.6.0.9.tbd to Linked Framework and Libraries

Android

  • in settings.gradle change:

    new File(rootProject.projectDir, '../node_modules/react-native-vlc-player/android')

    to

    new File(rootProject.projectDir, '../node_modules/react-native-vlc-player/android/vlc')

  • in MainApplication.java you need to import com.rusmigal.vlcplayer.VLCPlayerPackage instead of com.vlcplayer.VLCPlayerPackage

Usage

<VLCPlayer
    ref='vlcplayer'
    paused={this.state.paused}
    style={styles.vlcplayer}
    source={{uri: this.props.uri, initOptions: ['--codec=avcodec']}}
    onVLCProgress={this.onProgress.bind(this)}
    onVLCEnded={this.onEnded.bind(this)}
    onVLCStopped={this.onEnded.bind(this)}
    onVLCPlaying={this.onPlaying.bind(this)}
    onVLCBuffering={this.onBuffering.bind(this)}
    onVLCPaused={this.onPaused.bind(this)}
 />

Properties

source.initOptions - only for iOS rate - only for iOS snapshotPath - only for iOS

Callbacks

onBuffering - only for iOS

Static Methods

seek(seconds)

this.refs['vlcplayer'].seek(0.333);

snapshot(path)

this.refs['vlcplayer'].snapshot(path);

react-native-vlc-player's People

Contributors

dkyrychenko-sr avatar jehartzog avatar kikill95 avatar rmyhal 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.