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

vume-react-native-wowza-gocoder

v1.5.0

Published

React Native wrapper for the Wowza GoCoder SDK

Downloads

113

Readme

react-native-wowza-gocoder

Platform License Release

About

This is a Native Module for React Native that allows integration of Wowza's GoCoder SDK in less time. !Note* we require RN 0.42+ and GoCoderSDK 1.5.+ for this to work!

Getting started

$ npm install react-native-wowza-gocoder --save

Mostly automatic installation

$ react-native link react-native-wowza-gocoder

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-wowza-gocoder and add RNWowzaBroadcaster.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNWowzaBroadcaster.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<
Post installation iOS
  1. After obtaining WowzaGoCoderSDK framework and the wowzastatic-lib, add them both to a folder in the root directory of the project.
  2. Add the WowzaGoCoderSDK.framework to the build phases for your app target, add a copy files phase with the WowzaGoCoder.SDK http://www.wowza.com/resources/gocodersdk/docs/1.0/intro-installation/

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.rngocoder.RNWowzaBroadcasterPackage; to the imports at the top of the file
  • Add new RNWowzaBroadcasterPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-wowza-gocoder'
    project(':react-native-wowza-gocoder').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-wowza-gocoder/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-wowza-gocoder')
Post installation Android
  1. After obtaining WowzaGoCoderSDK aar file, add it to your nodemodules/react-native-wowza-gocoder to the libs directory(create it if needed), it's also need to add the dependency on your main app, add the aar file to libs directory(create it if needed).
  2. Then add the following lines to both build.gradle files, on nodemodules/react-native-wowza-gocoder and app/build.gradle
    repositories {
        flatDir {
            dirs 'libs'
        }
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
    
        // The GoCoder SDK library dependency declaration
        compile 'com.wowza.gocoder.sdk.android:com.wowza.gocoder.sdk:1.0@aar'
    
        // List additional dependencies here...
    
    }
  1. http://www.wowza.com/resources/gocodersdk/docs/1.0/intro-installation/

Usage

  1. Import the module import BroadcastView from 'react-native-wowza-gocoder';
  2. Set a config
const config ={
  hostAddress:'',
  applicationName:'',
  username:'',
  password:'',
  streamName:'',
  sdkLicenseKey:''
};
  1. Add functions for debug, testing
onBroadcastStart(){
  console.log("Bcast start");
}
onBroadcastFail(){
  console.log("Bcast fail");
}
onBroadcastStatusChange(){
  console.log("Bcast status change");
}
onBroadcastEventReceive(){
  console.log("Bcast event receive");
}
onBroadcastErrorReceive(){
  console.log("Bcast error receive");
}
onBroadcastVideoEncoded(){
  console.log("Bcast encoded");
}
onBroadcastStop(){
  console.log("Bcast stop");
}
  1. Use the component in render
<BroadcastView style= {styles.videoContainer}
                     hostAddress = {config.hostAddress}
                     applicationName = {config.applicationName}
                     broadcastName={config.streamName}
                     broadcasting = {false}
                     username = {config.username}
                     password = {config.password}
                     sizePreset = {3}
                     port={1935}
                     muted = {false}
                     flashOn = {false}
                     frontCamera =  {false}
                     onBroadcastStart= {this.onBroadcastStart}
                     onBroadcastFail= {this.onBroadcastFail}
                     onBroadcastStatusChange= {this.onBroadcastStatusChange}
                     onBroadcastEventReceive= {this.onBroadcastEventReceive}
                     onBroadcastErrorReceive= {this.onBroadcastErrorReceive}
                     onBroadcastVideoEncoded = {this.onBroadcastVideoEncoded}
                     onBroadcastStop = {this.onBroadcastStop}
                     sdkLicenseKey={config.sdkLicenseKey}
      >
  </BroadcastView> 
  1. Be sure to use absolute positioning on your styles otherwise the video may not show correctly

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  videoContainer:{
    position:'absolute',
    top:0,
    left:0,
    right:0,
    bottom:40
  }
});
  • Optional: If you are familiar with controlling state then you could trigger start/stop of streaming by passing state in the BroadcastView component prop broadcasting. example broadcasting = {false} to broadcasting = {this.state.brodcasting} * //Using the broadcast module

    var BroadcastManager = NativeModules.BroadcastModule;

    BroadcastManager.startTimer(1, 3600);

  • Android only - first argument - timer interval, second argument time to timeout timer in seconds

  • Stop Timer when stopping the broadcast - Android only
    BroadcastManager.stopTimer();

Running the example project

Install and link dependencies

cd react-native-wowza-gocoder/example
npm install
react-native-link

iOS

  1. Download the GoCoder SDK - https://www.wowza.com/pricing/installer#gocodersdk-downloads
  2. Unzip and add "wowzagocoder_static_lib" and "WowzaGoCoderSDK.framework" to /example/ios/
  3. Open /example/ios/example.xcodeproj in Xcode
  4. From the Xcode Project Navigator, select the "example" project and the "example" target
  5. On the "General" tab configure the "Identity" settings with your app bundle identifier (should match the bundleID tied to your GoCoder license)
    • If you don't have a license key you can register for a free trial: https://www.wowza.com/products/gocoder/sdk/trial
  6. Configure your "Signing" settings with your provisioning profiles
  7. Configure your GoCoder license key and Wowza server settings in example/wowzaConfig.js
  8. Run your project on a device (will not work properly on simulator)

Android

  1. Download the GoCoder SDK - https://www.wowza.com/pricing/installer#gocodersdk-downloads
  2. Unzip and add "com.wowza.gocoder.sdk.aar" to /example/android/app/libs/ (you may have to create the libs folder)
  3. Also add "com.wowza.gocoder.sdk.aar" to /example/node_modules/react-native-wowza-broadcaster/libs/
  4. Open /example/android in Android Studio and rename the package to match the package name tied to your GoCoder license
    • If you don't have a license key you can register for a free trial: https://www.wowza.com/products/gocoder/sdk/trial
  5. Configure your GoCoder license key and Wowza server settings in example/wowzaConfig.js
  6. Run your project on a device (will not work properly on simulator)

TODOS

  • [ ] Add better support for the size preset props for both platforms
  • [ ] Add support for Playback feature