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

@jellyfish-dev/react-native-client-sdk

v0.1.6

Published

React native client sdk for the Jellyfish server.

Downloads

16

Readme

CI

react-native-client-sdk

Jellyfish client SDK in React Native

Installation

npm install @jellyfish-dev/react-native-client-sdk

Expo plugin

Even though this is not a native library, it has a dependency on @jellyfish-dev/react-native-membrane-webrtc which requires native configuration. If you're using development builds with eas build or bare workflow you can try using expo plugin to do the configuration below for you. Simply run:

expo install @jellyfish-dev/react-native-client-sdk

Add plugin to your app.json:

{
  "expo": {
    "name": "example",
    ...
    "plugins": [
      "@jellyfish-dev/react-native-membrane-webrtc"
    ]
  }
}

On bare workflow run expo prebuild to configure the app, then run pod install. On development build eas build should take care of it.

Android

  1. Add camera and microphone permissions to your AndroidManifest.xml.
  2. For android 14+ add following code in your AndroidManifest.xml in application section :
<service
  android:name=".YourServiceName"
  android:foregroundServiceType="mediaProjection"
  android:exported="false">
  1. Rebuild the app. That's it!

iOS

On iOS installation is a bit more complicated, because you need to setup a screen broadcast app extension for screensharing.

  1. Add camera and microphone permissions to your main Info.plist.
    <key>NSCameraUsageDescription</key>
    <string>Allow $(PRODUCT_NAME) to use the camera</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>Allow $(PRODUCT_NAME) to use the microphone</string>
  2. We recommend adding audio background mode in Info.plist so that the app doesn't disconnect when it's in background:
	<key>UIBackgroundModes</key>
  <array>
    <string>audio</string>
  </array>
  1. Open your <your-project>.xcworkspace in Xcode

  2. Create new Broadcast Upload Extension. Select File → New → Target... → Broadcast Upload Extension → Next. Choose the name for the new target, select Swift language and deselect "Include UI Extension".

    New target config

    Press Finish. In the next alert xcode will ask you if you want to activate the new scheme - press Cancel.

  3. Configure app group. Go to "Signing & Capabilities" tab, click "+ Capability" button in upper left corner and select "App Groups".

    App groups config

    Then in the "App Groups" add a new group or select existing. Usually group name has format group.<your-bundle-identifier>. Verify that both app and extension targets have app group and dev team set correctly.

  4. A new folder with app extension should appear on the left with contents like this:

    App extension files

    Replace SampleHandler.swift with MembraneBroadcastSampleHandler.swift and this code:

    import Foundation
    import MembraneRTC
    import os.log
    import ReplayKit
    import WebRTC
    
    
    /// App Group used by the extension to exchange buffers with the target application
    let appGroup = "{{GROUP_IDENTIFIER}}"
    
    let logger = OSLog(subsystem: "{{BUNDLE_IDENTIFIER}}.MembraneBroadcastSampleHandler", category: "Broadcaster")
    
    /// An example `SampleHandler` utilizing `BroadcastSampleSource` from `MembraneRTC` sending broadcast samples and necessary notification enabling device's screencast.
    class MembraneBroadcastSampleHandler: RPBroadcastSampleHandler {
        let broadcastSource = BroadcastSampleSource(appGroup: appGroup)
        var started: Bool = false
    
    
        override func broadcastStarted(withSetupInfo _: [String: NSObject]?) {
            started = broadcastSource.connect()
    
            guard started else {
                os_log("failed to connect with ipc server", log: logger, type: .debug)
    
                super.finishBroadcastWithError(NSError(domain: "", code: 0, userInfo: nil))
    
                return
            }
    
            broadcastSource.started()
        }
    
        override func broadcastPaused() {
            broadcastSource.paused()
        }
    
        override func broadcastResumed() {
            broadcastSource.resumed()
        }
    
        override func broadcastFinished() {
            broadcastSource.finished()
        }
    
        override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType) {
            guard started else {
                return
            }
    
            broadcastSource.processFrame(sampleBuffer: sampleBuffer, ofType: sampleBufferType)
        }
    }

    Replace {{GROUP_IDENTIFIER}} and {{BUNDLE_IDENTIFIER}} with your group identifier and bundle identifier respectively.

  5. In project's Podfile add the following code:

    target 'MembraneScreenBroadcastExtension' do
      pod 'MembraneRTC/Broadcast'
    end

    This new dependency should be added outside of your application target. Example

    target 'ReactNativeMembraneExample' do
     ...
    end
    
    target 'MembraneScreenBroadcastExtension' do
     pod 'MembraneRTC/Broadcast'
    end
  6. Run pod install in your ios/ directory

  7. Add the following constants in your Info.plist:

    <key>AppGroupName</key>
    <string>{{GROUP_IDENTIFIER}}</string>
    <key>ScreencastExtensionBundleId</key>
    <string>{{BUNDLE_IDENTIFIER}}.MembraneBroadcastSampleHandler</string>

    Replace {{GROUP_IDENTIFIER}} and {{BUNDLE_IDENTIFIER}} with your group identifier and bundle identifier respectively.

  8. Rebuild the app and enjoy!

Docs

API documentation is available here

Usage

Make sure you have:

  • Running Jellyfish server.
  • Created room and token of peer in that room. You can use dashboard example to create room and peer token.

You can refer to our minimal example on how to use this library.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

Copyright and License

Copyright 2023, Software Mansion

Software Mansion

Licensed under the Apache License, Version 2.0