Giter Club home page Giter Club logo

react-native-vlc2's Introduction

react-native-vlc2

Move over to Stremio/react-native-vlc2

iOS is not supported yet

import React, { Component } from 'react';
import VLCVideo from 'react-native-vlc2';

class Player extends Component {
    play() {
        this.refs.video && this.refs.video.play();
    }

    pause() {
        this.refs.video && this.refs.video.pause();
    }

    seek(time) {
        this.refs.video && this.refs.video.seek(time);
    }

    render() {
        return (
            <VLCVideo
                ref={'video'}
                style={{ flex: 1 }}
                sourceUrl={'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'}
                autoplay={true}
                startTime={0}
            //   onSeekRequested={this.onSeekRequested}
            //   onBuffering={this.onBuffering}
            //   onPlaying={this.onPlaying}
            //   onPaused={this.onPaused}
            //   onEndReached={this.onEndReached}
            //   onError={this.onError}
            //   onTimeChanged={this.onTimeChanged}
            //   onSeekPerformed={this.onSeekPerformed}
            />
        );
    }
}

react-native-vlc2's People

Contributors

dependabot[bot] avatar nklhtv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

react-native-vlc2's Issues

Auto size with fixed one dimension

Hi!

What is the best way to auto size video view based on one dimension?

For example, I want to fix view width and get height calculated automatically based on video aspect ratio.

Application is not responsive after leaving video screen

See: https://github.com/Ivshti/react-native-vlc/issues/19

Output from logcat during playback at the moment the back key was pressed:

08-29 16:43:42.655  3976  3976 D ReactNative: ReactInstanceManager.detachViewFromInstance()
08-29 16:43:42.674  1637  1648 I WindowManager: Destroying surface Surface(name=SurfaceView - com.example/com.reactnativenavigation.controllers.NavigationActivity) called by com.android.server.wm.WindowStateAnimator.destroyDeferredSurfaceLocked:910 com.android.server.wm.WindowManagerService.performDeferredDestroyWindow:3114 com.android.server.wm.Session.performDeferredDestroy:225 android.view.IWindowSession$Stub.onTransact:398 com.android.server.wm.Session.onTransact:136 android.os.Binder.execTransact:565 <bottom of call stack> <bottom of call stack> 
08-29 16:43:42.689  3976  4032 D VLC     : [8f253ba8/fc0] core decoder: killing decoder fourcc `mlaw', 1 PES in FIFO
08-29 16:43:42.689  3976  4032 D VLC     : [8f253ba8/fc0] core decoder: removing module "g711"
08-29 16:43:42.690  3976  4032 D VLC     : [9621ee28/fc0] core audio resampler: removing module "ugly"
08-29 16:43:42.690  3976  4032 D VLC     : [8f2565a8/fc0] core audio converter: removing module "audio_format"
08-29 16:43:42.690  3976  4032 D VLC     : [8f256228/fc0] core audio filter: removing module "scaletempo"
08-29 16:43:42.690  3976  4032 D VLC     : [8f256928/fc0] core audio converter: removing module "trivial"
08-29 16:43:42.690  3976  4032 D VLC     : [8f256ca8/fc0] core audio converter: removing module "audio_format"
08-29 16:43:42.691  3976  4032 D VLC     : [a5338718/fc0] core volume: removing module "integer_mixer"
08-29 16:43:42.691  3976  4032 D VLC     : [a530d328/fc0] core generic: keeping audio output
08-29 16:43:42.692  3976  4032 D VLC     : [8f253f28/fc0] core decoder: killing decoder fourcc `h264', 0 PES in FIFO
08-29 16:43:42.692  3976  4032 D VLC     : [8f253f28/fc0] core decoder: removing module "avcodec"
08-29 16:43:42.700  3976  4032 D VLC     : [8f253f28/fc0] avcodec decoder: ffmpeg codec (h264) stopped
08-29 16:43:42.700  3976  4032 D VLC     : [a530d328/fc0] core generic: saving a free vout
08-29 16:43:42.700  3976  4032 D VLC     : [a530d328/fc0] core generic: reusing provided vout
08-29 16:43:42.701  3976  4032 D VLC     : [8f2542a8/fc0] core packetizer: removing module "h264"
08-29 16:43:42.701  3976  4032 D VLC     : [8f93f128/fc0] core demux: removing module "live555"
08-29 16:43:42.782  3976  4048 E VLC     : [9198dde8/fd0] core vout display: Failed to change zoom
08-29 16:43:42.782  3976  4048 D VLC     : [9198dde8/fd0] android_window vout display: change source crop/aspect
08-29 16:43:44.557  1637  1658 I art     : Starting a blocking GC Explicit
08-29 16:43:44.572  1637  1658 I art     : Explicit concurrent mark sweep GC freed 14785(669KB) AllocSpace objects, 0(0B) LOS objects, 19% free, 16MB/20MB, paused 177us total 15.232ms
08-29 16:43:45.733  1351  1377 W audio_hw_generic: Not supplying enough data to HAL, expected position 6150617 , only wrote 5296320
08-29 16:43:56.962  1637  1674 I InputDispatcher: Application is not responding: Window{34d631b u0 com.example/com.reactnativenavigation.controllers.NavigationActivity}.  It has been 5004.3ms since event, 5004.1ms since wait started.  Reason: Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago.  Wait queue length: 2.  Wait queue head age: 10761.2ms.

No suitable constructor found for VLCVideoPackage(no arguments)

Hello,

I can't use this plugin, can you help me? I can't build the application:

/MainApplication.java:27: error: no suitable constructor found for VLCVideoPackage(no arguments) new VLCVideoPackage() ^ constructor VLCVideoPackage.VLCVideoPackage(Application) is not applicable (actual and formal argument lists differ in length) constructor VLCVideoPackage.VLCVideoPackage(Application,ArrayList<String>) is not applicable (actual and formal argument lists differ in length) constructor VLCVideoPackage.VLCVideoPackage(Application,OnKeyListener) is not applicable (actual and formal argument lists differ in length) constructor VLCVideoPackage.VLCVideoPackage(Application,VLCVideoCallbackManager) is not applicable (actual and formal argument lists differ in length) constructor VLCVideoPackage.VLCVideoPackage(Application,ArrayList<String>,OnKeyListener) is not applicable (actual and formal argument lists differ in length) constructor VLCVideoPackage.VLCVideoPackage(Application,ArrayList<String>,VLCVideoCallbackManager) is not applicable (actual and formal argument lists differ in length) constructor VLCVideoPackage.VLCVideoPackage(Application,OnKeyListener,VLCVideoCallbackManager) is not applicable (actual and formal argument lists differ in length) constructor VLCVideoPackage.VLCVideoPackage(Application,ArrayList<String>,OnKeyListener,VLCVideoCallbackManager) is not applicable (actual and formal argument lists differ in length) 1 error
RN 0.59.10.

Thank you.

rtsp: slow closing after play

I tried to call pause () with componentWillUnmount but also slowly.
How to stop the vlc so that there is no delay when the component is destroyed?

Failed to open RTSP with 2.5.17

I have successfully opened RSTP streams using 2.0.3 version but with 2.5.17 I got an error.

VLC log contains:

03-05 06:13:34.310  5492  5492 D VLC     : [ce6677b0/654e6576] libvlc libvlc: VLC media player - 3.0.0-rc6 Vetinari
03-05 06:13:34.310  5492  5492 D VLC     : [ce6677b0/0] libvlc libvlc: Copyright © 1996-2018 the VideoLAN team
03-05 06:13:34.310  5492  5492 D VLC     : [ce6677b0/0] libvlc libvlc: revision 3.0.0-rc5-89-gced0c03
03-05 06:13:34.310  5492  5492 D VLC     : [ce6677b0/0] libvlc libvlc: configured with ../configure  '--host=i686-linux-android' '--build=x86_64-unknown-linux' '--with-contrib=/home/slim/vlc/vlc_source/vlc/contrib/i686-linux-android' '--disable-nls' '--enable-live555' '--enable-realrtsp' '--enable-avformat' '--enable-swscale' '--enable-avcodec' '--enable-opus' '--enable-opensles' '--enable-matroska' '--enable-taglib' '--enable-dvbpsi' '--disable-vlc' '--disable-shared' '--disable-update-check' '--disable-vlm' '--disable-dbus' '--enable-lua' '--disable-vcd' '--disable-v4l2' '--enable-dvdread' '--enable-dvdnav' '--disable-bluray' '--disable-linsys' '--disable-decklink' '--disable-libva' '--disable-dv1394' '--enable-mod' '--disable-sid' '--disable-gme' '--disable-tremor' '--disable-mad' '--enable-mpg123' '--disable-dca' '--disable-sdl-image' '--enable-zvbi' '--disable-fluidsynth' '--enable-fluidlite' '--disable-jack' '--disable-pulse' '--disable-alsa' '--disable-samplerate' '--disable-sdl' '--disable-xcb' '--disable-qt' '--disable-skins2' '--disable-mtp
03-05 06:13:34.310  5492  5492 D VLC     : [ce6677b0/cafe7940] libvlc libvlc: plug-ins loaded: 300 modules
...
03-05 06:13:34.317  5492  5492 D VLC     : [e1f1f830/1574] libvlc input: Creating an input for 'rtsp://192.168.1.6:554/user=xxx&password=xxx&channel=1&stream=0.sdp'
...
03-05 06:13:34.333  5492  5534 D VLC     : [ef3f5df0/159e] libvlc stream: net: connecting to 192.168.1.6 port 554
03-05 06:13:34.335  5492  5534 D VLC     : [ef3f5df0/159e] libvlc stream: connection succeeded (socket = 54)
03-05 06:13:34.339  5492  5534 D VLC     : [ef3f5df0/159e] libvlc stream: rtsp connected
03-05 06:13:34.339  5492  5534 W VLC     : [ef3f5df0/159e] libvlc stream: only real/helix rtsp servers supported for now
03-05 06:13:34.339  5492  5534 D VLC     : [ef3f5df0/159e] libvlc stream: no access modules matched
03-05 06:13:34.339  5492  5534 E VLC     : [e1f1f830/159e] libvlc input: Your input can't be opened
03-05 06:13:34.339  5492  5534 E VLC     : [e1f1f830/159e] libvlc input: VLC is unable to open the MRL 'rtsp://192.168.1.6:554/user=xxx&password=xxx&channel=1&stream=0.sdp'. Check the log for details.

Any suggestions?

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.