Giter VIP home page Giter VIP logo

jitsi-spot-sdk's Introduction

Spot SDK

The Spot SDK is a React native package to provide the Spot controller functionality to any React Native apps, such as Jitsi Meet.

Usage

1. Install the module

npm install jitsi-spot-sdk

2. Add and install peer dependencies

Check the package.json to see the most actual list of peerDependencies. To see what exact version the SDK was developed and tested against please also see the devDependencies section of the same file.

3. Add native stuff

3.1 iOS

3.1.1 Add the permissions to Info.plist

These permissions are needed to be able to detect nearby spot devices.

<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Allows MyFirstSpotApp to detect Spot TVs and Spot TV equipped meeting rooms nearby.</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Allows MyFirstSpotApp to detect Spot TVs and Spot TV equipped meeting rooms nearby.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Allows MyFirstSpotApp to detect Spot TVs and Spot TV equipped meeting rooms nearby.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Allows MyFirstSpotApp to detect Spot TVs and Spot TV equipped meeting rooms nearby.</string>
<key>NSLocationUsageDescription</key>
<string>Allows MyFirstSpotApp to detect Spot TVs and Spot TV equipped meeting rooms nearby.</string>

3.2 Android

3.2.1 Add the permission to your manifest

These permissions are needed to be able to detect nearby spot devices.

<uses-permission  android:name="android.permission.ACCESS_COARSE_LOCATION"/>

4. Initialize the SDK

Put the SDK initializer code to a part of your app that runs early enough (e.g. main view mount), but not in the module loading phase!

// Optional
SpotSDK.initialize(new Config({ /* config values come here, if needed */}));
// Optional
SpotSDK.startDeviceDetection();

5. Use the components

5.1 SpotStreamButton

SpotStreamButton is a button that will appear or disappear automatically should a nearby spot device is detected.

Props:

iconColor: Color of the rendered button (optional).
iconSize: Size of the rendered button (optional).
onPress: Callback to be invoked when the button is pressed.
style: External size to be applied (optional).
children: The component may have children, in which case the children are rendered as button, instead of the default icon.

5.2 SpotNearbyDevicesList

SpotNearbyDevicesList is a component to render the lis of nearby devices.

Props

defaultDeviceName: Device name to be displayed for devices with no available name (Optional).
onSelect: The callback to be invoked on selecting a device from the list.
style: External size to be applied (optional).

5.3 SpotView

SpotView is a view that renders the Spot remote controller screen.

Props

device: The device we want to control, if any. Otherwise a spot controller is opened with the code entry screen to control a non beacon-enabled instance (optional). style: External size to be applied (optional).

jitsi-spot-sdk's People

Contributors

saghul avatar zbettenbuk 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.