npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-videocore

v0.0.1

Published

A react-native wrapper for the VideoCore iOS library

Downloads

5

Readme

react-native-videocore

A React Native module for the VideoCore iOS library.

Getting started

  1. npm install react-native-videocore@latest --save
  2. Right click on your project on Xcode and then ➜ Add Files to [your project's name]
  3. Go to node_modules/react-native-videocore/ios/RNVideoCore and add RCTVideoCore
  4. Add VideoCore to your Podfile. If you don't have a Podfile yet see the instructions below
  5. Run your project

Usage

All you need is to require the react-native-videocore module and then use the tag.


var React = require('react-native');
var {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  TouchableHighlight
} = React;

var VideoCore = require('react-native-videocore')

var VideoCoreSampleApp = React.createClass({
  render: function() {
    return (
      <View style={styles.container}>
        <VideoCore style={{ alignSelf: 'stretch', flex: 1 }} onConnectionStatusChanged={(e) => console.log(e)}>
          <TouchableHighlight onPress={() => VideoCore.startStreaming('rtmp://104.155.71.82:1935/live', 'myStream')}><Text style={{color: "#fff", margin: 50}}>START Streaming</Text></TouchableHighlight>
          <TouchableHighlight onPress={() => VideoCore.stopStreaming()}><Text style={{color: "#fff", margin: 50}}>STOP Streaming</Text></TouchableHighlight>
        </VideoCore>
      </View>
    );
  }
});

var styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  }
});

AppRegistry.registerComponent('VideoCoreSampleApp', () => VideoCoreSampleApp);

Properties

onConnectionStatusChanged

Will call the specified method when VideoCore connection status has changed.

Possible values:

  • VCSessionStateStarting
  • VCSessionStateStarted
  • VCSessionStateError
  • VCSessionStateEnded
  • VCSessionStateNone
  • VCSessionStatePreviewStarted

Ex:

<VideoCore onConnectionStatusChanged={ (state) => console.log('Current state: ' + state) } />

I don't have a Podfile

1. Create a Podfile inside the ios folder

platform :ios, '9.0'

source 'https://github.com/CocoaPods/Specs.git'

# See: http://guides.cocoapods.org/making/making-a-cocoapod.html#release
# Once the pod has been released, use a version number here instead of a path.
pod 'VideoCore', :git => '[email protected]:phelrine/VideoCore.git', :branch => 'fixed-master'

As you can see, I actually use a fork which has some bugs already fixed.

2. Install Cocoapods and the dependencies

Inside ios folder run: sudo gem install cocoapods -v 0.37.2 && pod _0.37.2_ install Note: you must use this version because the latest versions of Cocoapods have a bug and your project won't run

3. Go to the Build Settings of your Xcode project and search for Linking

On the Other Linker Flags, make sure you have -ObjC and $(inherited) on the list

Known Issues

  • Only works with landscape orientation
  • Only works with CocoaPods < 0.37.2

Thanks to Loch Wansbrough (@lwansbrough) for the react-native-camera module which provided me with a great example of how to set up this module.