Code Monkey home page Code Monkey logo

opentok-react-native's Introduction

opentok-react-native

Tokbox is now known as Vonage

React Native library for using OpenTok.

This library is now officially supported by Vonage.

In this repo, you'll find the OpenTok React Native library.

Prerequisites

  1. Install node.js

  2. Install and update Xcode (you will need a Mac). (See the React Native iOS installation instructions.)

  3. Install and update Android Studio. (See the React Native Android installation instructions.)

System requirements

See the system requirements for the OpenTok Android SDK and OpenTok iOS SDK. (The OpenTok React Native SDK has the same requirements for Android and iOS.)

Installation

  1. In your terminal, change into your React Native project's directory.

  2. Add the library using npm or yarn:

  • npm install opentok-react-native
  • yarn add opentok-react-native

iOS Installation

  1. Install the iOS pods:

    npx pod-install
    
  2. For React Native versions prior to 0.60:

    • Add this to your Podfile:

      target '<YourProjectName>' do
          # Pods for <YourProject>
          pod 'OTXCFramework', '2.27.3'
      end
      
    • Run react-native link opentok-react-native.

    These steps are not necessary in React Native version 0.60 and later.

  3. Ensure you have enabled both camera and microphone usage by adding the following entries to the Info.plist file:

    <key>NSCameraUsageDescription</key>
    <string>Your message to user when the camera is accessed for the first time</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>Your message to user when the microphone is accessed for the first time</string>
    

When you create an archive of your app, the privacy manifest settings required by Apple's App store are added automatically with this version of the OpenTok React Native SDK.

If you try to archive the app and it fails, please do the following:

  1. Go to Target.

  2. Click Build Phases.

  3. Under the Link Binary With Libraries section, remove libOpenTokReactNative.a and add it again.

Android Installation

  1. In your terminal, change into your project directory.

  2. For React Native versions prior to 0.60:

    • Run react-native link opentok-react-native

    This step is not necessary in React Native version 0.60 and later.

  3. Run bundle install.

  4. Make sure the following in your app's gradle compileSdkVersion, buildToolsVersion, minSdkVersion, and targetSdkVersion are greater than or equal to versions specified in the OpenTok React Native library.

  5. For older Android devices, add the following permissions to the AndroidManifest.xml file:

    • android.permission.BLUETOOTH -- The default audio device supports Bluetooth audio. If your app does not use the default audio device and does not use Bluetooth, you can remove this permission.

    • android.permission.BLUETOOTH_CONNECT -- You need to enable this for API level 31 and above. If you want to use the Bluetooth device with Android SDK DefaultAudioDevice targeting API level 31 and above, please ask for runtime permissions in the app or enable the ("Nearby devices/Bluetooth") permission manually in the app settings.

    • android.permission.BROADCAST_STICKY -- We have determined that this is unused by the OpenTok Android SDK, and we will remove this permission from an upcoming release.

    • android.permission.CAMERA -- If your app does not use the default video capturer and does not access the camera, you can remove this permission.

    • android.permission.INTERNET -- Required.

    • android.permission.MODIFY_AUDIO_SETTINGS -- If your app does not use the default audio device and does not access the microphone, you can remove this permission.

    • android.permission.READ_PHONE_STATE -- The OpenTok Android SDK requests this permission in API level 22 and lower, and 31 and above.

    • android.permission.RECORD_AUDIO -- If your app does not use the default audio device and does not access the microphone, you can remove this permission.

    For newer versions of Android — API Level 23 (Android 6.0) and later — you do not need to add these to your app manifest. The OpenTok React Native SDK adds them automatically. However, if you use Android 21+, certain permissions require you to prompt the user.

    Your app can remove any of these permissions that will not be required. See this post and this Android documentation. For example, this removes the android.permission.CAMERA permission:

    <uses-permission android:name="android.permission.CAMERA" tools:node="remove"/>
    

Bintray sunset

Bintray support has ended (official announcement: https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/). In your app build.gradle file you need to remove reference to jcenter and replace it with mavenCentral. Example:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ...
    repositories {
        google()
        mavenCentral()
    }
    ...
}

allprojects {
    repositories {
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        mavenCentral {
            // We don't want to fetch react-native from Maven Central as there are
            // older versions over there.
            content {
                excludeGroup "com.facebook.react"
            }
        }
        google()
        maven { url 'https://www.jitpack.io' }
    }
}

Docs

See the docs.

Samples

To see this library in action, check out the opentok-react-native-samples repo.

Development and Contributing

Interested in contributing? We ❤️ pull requests! See the Contribution guidelines.

Getting Help

We love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:

opentok-react-native's People

Contributors

abdulajet avatar akodate avatar artemserga avatar cnx-carlosvogt avatar dtaborda avatar enricop89 avatar evillemez avatar ggoldens avatar gregorynative avatar haytran1 avatar haytran94 avatar jeffswartz avatar jvalli avatar lucashuang0802 avatar marinaserranomontes avatar martinharkins avatar mbouxin avatar michaeljolley avatar mingtsay avatar msach22 avatar necromant1k avatar nicwise avatar pedro-cerdera avatar pietgk avatar snobear avatar t-mdo avatar tomek29k avatar xxsnakerxx avatar yasithdev avatar ythecombinator avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opentok-react-native's Issues

Android app crash

Hi, I'm facing the following problem with Android device. When build dev app (android studio or react-native run-andriod) the app builds and installs normally. When I try to open my view containing session, publisher and subscriber the app asks for permissions. Without touching alerts the app crashes with "Unfortunately, APP has stopped". After restarting the app everything is ok.
This is my opentok build.gradle:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"
    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
}
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.facebook.react:react-native:+'
    // From node_modules
    compile 'com.opentok.android:opentok-android-sdk:2.14.0'
}

and here is my AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.healthyco">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-feature android:name="android.hardware.camera" android:required="true" />
    <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
    <uses-feature android:name="android.hardware.microphone" android:required="true" />

    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:allowBackup="true"
      android:theme="@style/AppTheme">
      <activity
        android:name=".SplashActivity"
        android:theme="@style/SplashTheme">
        <intent-filter>
          <action android:name="android.intent.action.MAIN" />
          <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
      <activity
        android:name=".MainActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:windowSoftInputMode="adjustResize"
        android:screenOrientation="portrait"
        android:exported="true">
      </activity>
      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
    </application>

</manifest>

Any idea where is my mistake?

As a user i can't connect from phone to already existing stream

As a user when i'm connectin to already existing stream i don't see any subscribers there even though if they are there

quick example: You already have web stream with n users, now you want to connect to this stream through your phone as publisher - You can see only yourself. Others subscribers not available

Request for suscribeToAudio and subscribeToVideo evolution

It would be great to be able to change the flags subscribeToAudio and subscribeToVideo on the OTSubscriber.

The idea would be to call subscribeToAudio for every streams in the OTSubscriber with the provided bool value.

I already developed it for my needs and can open a pull request if you want.

Attempt to invoke virtual method 'void android.widget.FrameLayout.removeAllViews()' on a null object reference

RN 0.51
OT RN 0.6.4

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.FrameLayout.removeAllViews()' on a null object reference
at com.opentokreactnative.OTSessionManager$2.run(OTSessionManager.java:281)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5343)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)

Does opentok-react-native work with Expo?

Hi, I'm looking to build an app with create-react-native which uses Expo, but I'm reading that Expo does not have support for WebRTC.

I only have experience developing w/ Opentok SDKs on desktop, but I'm assuming the WebRTC protocol is still used under the hood on mobile as well. But before I completely rule out using Expo, I wanted to confirm whether or not I could use Expo + opentok-react-native. Thanks for any info.

Console Error (OTSessionErrorDomain error 1113) when Unmounting OT Components

Thanks for this awesome new library! Very clean and so far I have it working on iOS.

I noticed on iOS that I receive an error anytime I unmount the Video component which contains the OTSession, Publisher and Subscriber components.

I don't have any significant event handlers or anything that I think would be causing an issue.
This is the specific error message that's logged in my React Native Debugger, after unmounting:
screen shot 2018-04-12 at 3 30 52 pm

Is there anything I should do before I unmount the my component containing the OT components?

Here is the abbreviated JSX that I'm unmounting, leading to the error:

class Video extends Component ....

handleStreamEvent = () => {
    this.startTimer();
    this.setState(({ streamActive }) => ({
      streamActive: !streamActive,
    }));
  };

  sessionEventHandlers = {
    streamCreated: this.handleStreamEvent,
    streamDestroyed: this.handleStreamEvent,
  };
    //
          <OTSession
            sessionId={sessionId}
            apiKey={tokBoxApiKey.toString()}
            token={token}
            style={{ flex: 1 }}
            eventHandlers={this.sessionEventHandlers}
          >
            <OTSubscriber style={{ width: '100%', height: '100%' }} />
            <OTPublisher
              style={styles.publisherContainer}
              properties={{
                publishAudio,
                publishVideo,
              }}
            />
          </OTSession>

Unhandled JS Exception: error is not defined

I've been struggling with this error:

captura de tela 2018-04-23 as 17 21 07

Which results in this being print on the simulator:

captura de tela 2018-04-23 as 15 35 07

I spent a little time checking the source of this lib and it seems that handleError defined here is being called here without any parameter so error is undefined.

Turns out that I can't even manage to find any error itself given that everything I pass down to OpenTok components is okay.

This is the source:

// ...
    const {openTok} = environment.settings;
    const {session, token} = this.props.details;
// ...
        {(this.props.status === Status.connected || this.props.status === Status.connecting) && (
          <View style={styles.callContainer}>
            <OTSession apiKey={openTok.apiKey} sessionId={session} token={token}>
              <OTPublisher
                style={{width: 100, height: 100}}
                properties={{
                  publishAudio: this.state.publishAudio,
                  cameraPosition: this.state.cameraPosition,
                }}
                eventHandlers={{
                  streamCreated: this.onRoomDidConnect,
                }}
              />
              <OTSubscriber style={{width: 100, height: 100}} />
            </OTSession>
//...

And logging stuff shows that my props are valid:

captura de tela 2018-04-23 as 17 40 11

Any ideas of what's going on?

unable to wrap own views

Stuck with one problem.
So basically we want to wrap our components with <OTSession> like we do with <View>.
But, when we will do that - our components just disappear.

Android crashes when unmounting OTSession

Hi,

We are encountering a crash whenever a View containing OTSession unmounts really fast.

E.g. Start a Session then click the Android back really fast to unmount the View, the crash does not trigger a RN error but instead crashes the APP with the following ADB log:

05-18 23:08:48.656 518 534 W ActivityManager: Activity pause timeout for ActivityRecord{19b46e0 u0 com.uecareapp/.MainActivity t32 f}
05-18 23:08:59.478 518 534 W ActivityManager: Activity destroy timeout for ActivityRecord{19b46e0 u0 com.uecareapp/.MainActivity t32 f}
...

If we run with the JS debugger we get:
05-18 23:07:29.910 4832 4832 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.ViewGroup.removeAllViews()' on a null object reference
05-18 23:07:29.910 4832 4832 E AndroidRuntime: at com.opentokreactnative.OTSessionManager$2.run(OTSessionManager.java:281)
05-18 23:07:29.910 4832 4832 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:751)
...

Our current workaround is to delay unmounting of the parent View by approximately 2s so the crash would not happen.

Signaling Issue - Android

When you receive a signal without a type, the app crashes because the app attempts to log a string, but fails because it's null

Session does not fully disconnect after component is dismounted

Apparently the native application context or the javascript thread are not being reset after the video call scene is dismounted. After opening, exiting, and re-entering a call, the events from the previous session keeps executing.

Steps to simulate the error.

  1. Open a call
  2. Set listeners for Session, Publisher, and Subscriber and print with the random number.
  3. Exit call screen
  4. Start the call again

IOS crashes with EXC_BAD_ACCESS when unmounting using streamDestroyed events

I face an error while unmounting OTSession, OTPublisher and OTSuscriber at the same time.

The streamDestroyed event called for the destroyed publisher causes a call in prepareJSEventData that raises the EXC_BAD_ACCESS at line:
streamInfo["connectionId"] = stream.connection.connectionId;

Simply commenting this line solves my problem.

OTScreenCapturer Unresolved

I'm seeing this issue on master version of this project when building with Xcode.

screen shot 2018-05-14 at 5 44 45 pm

Use of unresolved identifier 'OTScreenCapturer

Any solutions for the same?

Runtime error on iOS

Hello 😃

I've followed all the steps described here and watched the specific videocast for react native. Turns out that I tested the base components here and they led me to a runtime error on iOS:

captura de tela 2018-04-18 as 23 16 39

Here's the sample code that causes the error:

import * as React from 'react';
import {Text, TextInput, TouchableOpacity, View} from 'react-native';
import {connect} from 'react-redux';
import {Button} from 'native-base';
import {OTPublisher, OTSession, OTSubscriber} from 'opentok-react-native';

import {Status, User} from 'models';

import {
  mapDispatchToProps,
  MapDispatchToProps,
  mapStateToProps,
  MapStateToProps,
} from './Call.selectors';
import {styles} from './Call.style';

export type CallProps = {
  user: User;
} & MapDispatchToProps &
  MapStateToProps;

interface CallState {}

// These are not empty I just removed when pasting the snippet here, but they are valid and created on console for experimenting
const credentials = {
  apiKey: '',
  sessionId: '',
  token: '',
};

const publisherProperties = {
  publishAudio: false,
  cameraPosition: 'front',
};

const publisherEventHandlers = {
  streamCreated: (event) => {
    console.log('Publisher stream created!', event);
  },
  streamDestroyed: (event) => {
    console.log('Publisher stream destroyed!', event);
  },
};

export class CallComponent extends React.Component<CallProps, CallState> {
  // Call events

  onRoomDidConnect = () => {
    this.props.actions.setStatus(Status.connected);
  };

  onRoomDidFailToConnect = (error) => {
    console.log('ERROR: ', error);

    this.props.actions.setStatus(Status.disconnected);
  };

  onRoomDidDisconnect = ({error}) => {
    console.log('ERROR: ', error);
    this.props.actions.setStatus(Status.disconnected);
  };

  // UI events

  onConnectButtonPress = () => {
    this.props.actions.setStatus(Status.connecting);
    console.log('onConnectButtonPress:', this.props);
  };

  onEndButtonPress = () => {
    this.props.actions.setStatus(Status.disconnected);
  };

  onMuteButtonPress = () => {};

  onFlipButtonPress = () => {};

  render() {
    return (
      <View style={styles.container}>
        <OTSession
          apiKey={credentials.apiKey}
          sessionId={credentials.sessionId}
          token={credentials.token}
        >
          <OTPublisher
            properties={publisherProperties}
            eventHandlers={publisherEventHandlers}
            style={{width: 100, height: 100}}
          />
          <OTSubscriber style={{width: 100, height: 100}} />
        </OTSession>
      </View>
    );
  }
}

export const Call = connect(mapStateToProps, mapDispatchToProps)(CallComponent);
export const UnconnectedCall = CallComponent;

One could argue that the issue is somewhere in my app logic–but it turns out that just replacing <OTSession> and its children with any other component–e.g. a <Text> the app just stops crashing.

Do you have any idea on this?

Thanks in advance 😄

Build 0.6.2 failing on iOS

** BUILD FAILED **

The following build commands failed:

CompileSwift normal x86_64 /Users/.../node_modules/opentok-react-native/ios/OTSessionManager.swift
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler

(2 failures)

Cannot build for Android (v0.6.1)

Hi,
I'm with v0.6.1 and follow installation instructions but cannot build a simple app for Android, which is created with react-native init. The errors are in OTSessionManager.java
/Projects/testOpenTok/node_modules/opentok-react-native/android/src/main/java/com/opentokreactnative/OTSessionManager.java Error:(102, 13) error: cannot find symbol class View Error:(127, 9) error: cannot find symbol variable mPublisher Error:(128, 9) error: cannot find symbol variable mPublisher Error:(129, 9) error: cannot find symbol variable mPublisher Error:(130, 9) error: cannot find symbol variable mPublisher Error:(131, 9) error: cannot find symbol variable mPublisher Error:(133, 38) error: cannot find symbol variable mPublisher

Network test

Is it possible to expose the functionality of connection testing between clients from native SDKs?

EXC_BAD_ACCESS: Attempted to dereference garbage pointer 0x47d6cbec8.

Error while finishing the videocall in production.

OS Version: iOS 11.3.1 (15E302)
Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: BUS_NOOP at 0x000000047d6cbec8
Crashed Thread: 0

Application Specific Information:
Attempted to dereference garbage pointer 0x47d6cbec8.

Thread 0 Crashed:
0 libobjc.A.dylib 0x302fec1a0 objc_retain
1 falafreud 0x204726ff4
2 falafreud 0x20472d0b4
3 falafreud 0x20471c544
4 falafreud 0x2047f2dac folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const*>*)
5 libdispatch.dylib 0x303e47b24 _dispatch_call_block_and_release
6 libdispatch.dylib 0x303e47ae4 _dispatch_client_callout
7 libdispatch.dylib 0x303e546e0 _dispatch_main_queue_callback_4CF$VARIANT$mp
8 CoreFoundation 0x304ac8070 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
9 CoreFoundation 0x304ac5bc8 __CFRunLoopRun
10 CoreFoundation 0x3049e5da8 CFRunLoopRunSpecific
11 GraphicsServices 0x3089ab020 GSEventRunModal
12 UIKit 0x31869578c UIApplicationMain
13 falafreud 0x204710528
14 libdyld.dylib 0x303f12fc0 start

Thread 1 name: com.apple.uikit.eventfetch-thread
0 libsystem_kernel.dylib 0x30412ee08 mach_msg_trap
1 libsystem_kernel.dylib 0x30412ec80 mach_msg
2 CoreFoundation 0x304ac7e40 __CFRunLoopServiceMachPort
3 CoreFoundation 0x304ac5908 __CFRunLoopRun
4 CoreFoundation 0x3049e5da8 CFRunLoopRunSpecific
5 Foundation 0x305ed2674 -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
6 Foundation 0x305ed251c -[NSRunLoop(NSRunLoop) runUntilDate:]
7 UIKit 0x31837a7e4 -[UIEventFetcher threadMain]
8 Foundation 0x305fe2efc NSThread__start
9 libsystem_pthread.dylib 0x3044b0220 _pthread_body
10 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 2 name: com.facebook.react.JavaScript
0 JavaScriptCore 0x3124641e0 llint_entry
1 JavaScriptCore 0x31246a728 [inlined] llint_entry
2 JavaScriptCore 0x31246a728 [inlined] llint_entry
3 JavaScriptCore 0x31246a728 [inlined] llint_entry
4 JavaScriptCore 0x31246a728 llint_entry
5 JavaScriptCore 0x31246a79c [inlined] llint_entry
6 JavaScriptCore 0x31246a79c [inlined] llint_entry
7 JavaScriptCore 0x31246a79c [inlined] llint_entry
8 JavaScriptCore 0x31246a79c [inlined] llint_entry
9 JavaScriptCore 0x31246a79c llint_entry
10 JavaScriptCore 0x312463470 llintPCRangeStart
11 JavaScriptCore 0x312a14a74 JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*)
12 JavaScriptCore 0x31236c40c JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
13 JavaScriptCore 0x312bbffe8 JSC::boundThisNoArgsFunctionCall(JSC::ExecState*)
14 JavaScriptCore 0x31246b2b4 llint_entry
15 JavaScriptCore 0x31246a79c [inlined] llint_entry
16 JavaScriptCore 0x31246a79c [inlined] llint_entry
17 JavaScriptCore 0x31246a79c llint_entry
18 JavaScriptCore 0x312463470 llintPCRangeStart
19 JavaScriptCore 0x312a14a74 JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*)
20 JavaScriptCore 0x31236c40c JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
21 JavaScriptCore 0x312bbffe8 JSC::boundThisNoArgsFunctionCall(JSC::ExecState*)
22 JavaScriptCore 0x31246b2b4 llint_entry
23 JavaScriptCore 0x31246ac58 llint_entry
24 JavaScriptCore 0x31246a728 llint_entry
25 JavaScriptCore 0x31246a79c llint_entry
26 JavaScriptCore 0x31246a728 llint_entry
27 JavaScriptCore 0x312463470 llintPCRangeStart
28 JavaScriptCore 0x312a14a74 JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*)
29 JavaScriptCore 0x31236c40c JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
30 JavaScriptCore 0x312bbffe8 JSC::boundThisNoArgsFunctionCall(JSC::ExecState*)
31 JavaScriptCore 0x3124635b8 vmEntryToNative
32 JavaScriptCore 0x31236c454 JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
33 JavaScriptCore 0x312b37540 JSC::profiledCall(JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
34 JavaScriptCore 0x31236c11c JSObjectCallAsFunction
35 falafreud 0x2047ade24 RCTFBQuickPerformanceLoggerConfigureHooks
36 falafreud 0x2047cd96c folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const*>)
37 falafreud 0x2047ccae0 folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const
>*)
38 falafreud 0x20475b968
39 falafreud 0x204753ad0
40 CoreFoundation 0x304ac82bc CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK
41 CoreFoundation 0x304ac7a7c __CFRunLoopDoBlocks
42 CoreFoundation 0x304ac5abc __CFRunLoopRun
43 CoreFoundation 0x3049e5da8 CFRunLoopRunSpecific
44 falafreud 0x2047361c0
45 Foundation 0x305fe2efc NSThread__start
46 libsystem_pthread.dylib 0x3044b0220 _pthread_body
47 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 3
0 libsystem_kernel.dylib 0x3041500f4 __psynch_cvwait
1 libsystem_pthread.dylib 0x3044b2c90 _pthread_cond_wait$VARIANT$mp
2 libc++.1.dylib 0x302ed92ec std::__1::condition_variable::__do_timed_wait(std::__1::unique_lockstd::__1::mutex&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<(long)1, (long)1000000000> > >)
3 JavaScriptCore 0x312de3430 std::__1::cv_status std::__1::condition_variable::wait_until<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<(long)1, (long)1000000000> > >(std::__1::unique_lockstd::__1::mutex&, std::__1::chrono::time_point<std::...
4 JavaScriptCore 0x312de32e0 std::__1::cv_status std::__1::condition_variable_any::wait_until<std::__1::unique_lockbmalloc::Mutex, std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<(long)1, (long)1000000000> > >(std::__1::unique_lock<bmalloc::M...
5 JavaScriptCore 0x312de2e24 bmalloc::Scavenger::threadRunLoop()
6 JavaScriptCore 0x312de2b60 bmalloc::Scavenger::threadEntryPoint(bmalloc::Scavenger*)
7 JavaScriptCore 0x312de2f7c void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_deletestd::__1::__thread_struct >, void ()(bmalloc::Scavenger), bmalloc::Scavenger*> >(void*)
8 libsystem_pthread.dylib 0x3044b0220 _pthread_body
9 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 4 name: WebThread
0 libsystem_kernel.dylib 0x30412ee08 mach_msg_trap
1 libsystem_kernel.dylib 0x30412ec80 mach_msg
2 CoreFoundation 0x304ac7e40 __CFRunLoopServiceMachPort
3 CoreFoundation 0x304ac5908 __CFRunLoopRun
4 CoreFoundation 0x3049e5da8 CFRunLoopRunSpecific
5 WebCore 0x314ecad9c RunWebThread(void*)
6 libsystem_pthread.dylib 0x3044b0220 _pthread_body
7 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 5 name: GAIThread
0 libsystem_kernel.dylib 0x30412ee08 mach_msg_trap
1 libsystem_kernel.dylib 0x30412ec80 mach_msg
2 CoreFoundation 0x304ac7e40 __CFRunLoopServiceMachPort
3 CoreFoundation 0x304ac5908 __CFRunLoopRun
4 CoreFoundation 0x3049e5da8 CFRunLoopRunSpecific
5 Foundation 0x305ed2674 -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
6 Foundation 0x305f471a8 -[NSRunLoop(NSRunLoop) run]
7 falafreud 0x204db988c __cxa_throw
8 Foundation 0x305fe2efc NSThread__start
9 libsystem_pthread.dylib 0x3044b0220 _pthread_body
10 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 6 name: AVAudioSession Notify Thread
0 libsystem_kernel.dylib 0x30412ee08 mach_msg_trap
1 libsystem_kernel.dylib 0x30412ec80 mach_msg
2 CoreFoundation 0x304ac7e40 __CFRunLoopServiceMachPort
3 CoreFoundation 0x304ac5908 __CFRunLoopRun
4 CoreFoundation 0x3049e5da8 CFRunLoopRunSpecific
5 AVFAudio 0x30ff36424 GenericRunLoopThread::Entry(void*)
6 AVFAudio 0x30ff60834 CAPThread::Entry(CAPThread*)
7 libsystem_pthread.dylib 0x3044b0220 _pthread_body
8 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 7
0 libsystem_kernel.dylib 0x304150610 __semwait_signal
1 libsystem_c.dylib 0x303f9712c nanosleep
2 libsystem_c.dylib 0x303fffef4 sleep
3 falafreud 0x204d4a5fc __cxa_throw
4 libsystem_pthread.dylib 0x3044b0220 _pthread_body
5 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 8 name: KSCrash Exception Handler (Secondary)
0 libsystem_kernel.dylib 0x30412ee08 mach_msg_trap
1 libsystem_kernel.dylib 0x30412ec80 mach_msg
2 falafreud 0x204d1951c __cxa_throw
3 libsystem_pthread.dylib 0x3044b0220 _pthread_body
4 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 10 name: com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib 0x30412ee08 mach_msg_trap
1 libsystem_kernel.dylib 0x30412ec80 mach_msg
2 CoreFoundation 0x304ac7e40 __CFRunLoopServiceMachPort
3 CoreFoundation 0x304ac5908 __CFRunLoopRun
4 CoreFoundation 0x3049e5da8 CFRunLoopRunSpecific
5 CFNetwork 0x3059bc4b0 -[__CoreSchedulingSetRunnable runForever]
6 Foundation 0x305fe2efc NSThread__start
7 libsystem_pthread.dylib 0x3044b0220 _pthread_body
8 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 11 name: com.squareup.SocketRocket.NetworkThread
0 libsystem_kernel.dylib 0x30412ee08 mach_msg_trap
1 libsystem_kernel.dylib 0x30412ec80 mach_msg
2 CoreFoundation 0x304ac7e40 __CFRunLoopServiceMachPort
3 CoreFoundation 0x304ac5908 __CFRunLoopRun
4 CoreFoundation 0x3049e5da8 CFRunLoopRunSpecific
5 Foundation 0x305ed2674 -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
6 falafreud 0x204ee13bc __cxa_throw
7 Foundation 0x305fe2efc NSThread__start
8 libsystem_pthread.dylib 0x3044b0220 _pthread_body
9 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 12 name: com.apple.CFSocket.private
0 libsystem_kernel.dylib 0x304150538 select$DARWIN_EXTSN
1 CoreFoundation 0x304ad0378 __CFSocketManager
2 libsystem_pthread.dylib 0x3044b0220 _pthread_body
3 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 13 name: com.apple.coreaudio.AQClient
0 libsystem_kernel.dylib 0x30412ee08 mach_msg_trap
1 libsystem_kernel.dylib 0x30412ec80 mach_msg
2 CoreFoundation 0x304ac7e40 __CFRunLoopServiceMachPort
3 CoreFoundation 0x304ac5908 __CFRunLoopRun
4 CoreFoundation 0x3049e5da8 CFRunLoopRunSpecific
5 AudioToolbox 0x30c4a048c GenericRunLoopThread::Entry(void*)
6 AudioToolbox 0x30c6d0128 CAPThread::Entry(CAPThread*)
7 libsystem_pthread.dylib 0x3044b0220 _pthread_body
8 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 14
0 libsystem_kernel.dylib 0x304150d84 __workq_kernreturn
1 libsystem_pthread.dylib 0x3044aeeb4 _pthread_wqthread

Thread 15
0 libsystem_kernel.dylib 0x304150d84 __workq_kernreturn
1 libsystem_pthread.dylib 0x3044aeeb4 _pthread_wqthread

Thread 16
0 libsystem_kernel.dylib 0x30413334c kevent
1 falafreud 0x204cff544 otk_displayer_impl::ReleaseFrameCB(void*)
2 falafreud 0x204cfb4e0 otk_displayer_impl::ReleaseFrameCB(void*)
3 falafreud 0x204cb905c folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const*>)
4 falafreud 0x2047e4f00 folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const
>*)
5 libsystem_pthread.dylib 0x3044b0220 _pthread_body
6 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 17
0 libsystem_kernel.dylib 0x3041500f4 __psynch_cvwait
1 libsystem_pthread.dylib 0x3044b2c90 _pthread_cond_wait$VARIANT$mp
2 falafreud 0x204d06304 otk_displayer_impl::ReleaseFrameCB(void*)
3 falafreud 0x204d00bd0 otk_displayer_impl::ReleaseFrameCB(void*)
4 falafreud 0x204d05f58 otk_displayer_impl::ReleaseFrameCB(void*)
5 libsystem_pthread.dylib 0x3044b0220 _pthread_body
6 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 18
0 libsystem_kernel.dylib 0x3041500f4 __psynch_cvwait
1 libsystem_pthread.dylib 0x3044b2c90 _pthread_cond_wait$VARIANT$mp
2 falafreud 0x204d06304 otk_displayer_impl::ReleaseFrameCB(void*)
3 falafreud 0x204d00bd0 otk_displayer_impl::ReleaseFrameCB(void*)
4 falafreud 0x204d05f58 otk_displayer_impl::ReleaseFrameCB(void*)
5 libsystem_pthread.dylib 0x3044b0220 _pthread_body
6 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 19
0 libsystem_kernel.dylib 0x3041500f4 __psynch_cvwait
1 libsystem_pthread.dylib 0x3044b2c90 _pthread_cond_wait$VARIANT$mp
2 falafreud 0x204d06304 otk_displayer_impl::ReleaseFrameCB(void*)
3 falafreud 0x204d00bd0 otk_displayer_impl::ReleaseFrameCB(void*)
4 falafreud 0x204d05f58 otk_displayer_impl::ReleaseFrameCB(void*)
5 libsystem_pthread.dylib 0x3044b0220 _pthread_body
6 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 20
0 libsystem_kernel.dylib 0x3041500f4 __psynch_cvwait
1 libsystem_pthread.dylib 0x3044b2c90 _pthread_cond_wait$VARIANT$mp
2 falafreud 0x204d06304 otk_displayer_impl::ReleaseFrameCB(void*)
3 falafreud 0x204d00bd0 otk_displayer_impl::ReleaseFrameCB(void*)
4 falafreud 0x204d05f58 otk_displayer_impl::ReleaseFrameCB(void*)
5 libsystem_pthread.dylib 0x3044b0220 _pthread_body
6 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 21 name: Thread 0x0x106069ed0
0 libsystem_kernel.dylib 0x304150538 select$DARWIN_EXTSN
1 falafreud 0x204838b88 folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const*>)
2 falafreud 0x20482a070 folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const
>)
3 falafreud 0x2048470cc folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const
>)
4 falafreud 0x20484700c folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const
>*)
5 libsystem_pthread.dylib 0x3044b0220 _pthread_body
6 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 22 name: Thread 0x0x117710c90
0 libsystem_kernel.dylib 0x304150538 select$DARWIN_EXTSN
1 falafreud 0x204838b88 folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const*>)
2 falafreud 0x20482a070 folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const
>)
3 falafreud 0x2048470cc folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const
>)
4 falafreud 0x20484700c folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const
>*)
5 libsystem_pthread.dylib 0x3044b0220 _pthread_body
6 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 23 name: Thread 0x0x106061210
0 libsystem_kernel.dylib 0x304150538 select$DARWIN_EXTSN
1 falafreud 0x204838b88 folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const*>)
2 falafreud 0x20482a070 folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const
>)
3 falafreud 0x2048470cc folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const
>)
4 falafreud 0x20484700c folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const
>*)
5 libsystem_pthread.dylib 0x3044b0220 _pthread_body
6 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 24 name: VoiceProcessThread
0 libsystem_kernel.dylib 0x3041500f4 __psynch_cvwait
1 libsystem_pthread.dylib 0x3044b2c90 _pthread_cond_wait$VARIANT$mp
2 falafreud 0x20484c910 folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const*>)
3 falafreud 0x2048f4788 folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const
>)
4 falafreud 0x204b17bcc folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const
>)
5 falafreud 0x20484eedc folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const
>)
6 falafreud 0x20484ed68 folly::Expected<long long, folly::ConversionCode> folly::detail::str_to_integral(folly::Range<char const
>*)
7 libsystem_pthread.dylib 0x3044b0220 _pthread_body
8 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 25
0 libsystem_kernel.dylib 0x304150d84 __workq_kernreturn
1 libsystem_pthread.dylib 0x3044aeeb4 _pthread_wqthread

Thread 26 name: WTF::AutomaticThread
0 libsystem_kernel.dylib 0x3041500f4 __psynch_cvwait
1 libsystem_pthread.dylib 0x3044b2c90 _pthread_cond_wait$VARIANT$mp
2 JavaScriptCore 0x3123372c0 WTF::ThreadCondition::timedWait(WTF::Mutex&, double)
3 JavaScriptCore 0x312dc873c WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&)
4 JavaScriptCore 0x31288921c bool WTF::Condition::waitUntilWTF::Lock(WTF::Lock&, WTF::TimeWithDynamicClockType const&)
5 JavaScriptCore 0x312dadd18 WTF::Function<void ()>::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0>::call()
6 JavaScriptCore 0x312dda024 WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*)
7 JavaScriptCore 0x312332984 WTF::wtfThreadEntryPoint(void*)
8 libsystem_pthread.dylib 0x3044b0220 _pthread_body
9 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 27 name: WTF::AutomaticThread
0 libsystem_kernel.dylib 0x3041500f4 __psynch_cvwait
1 libsystem_pthread.dylib 0x3044b2c90 _pthread_cond_wait$VARIANT$mp
2 JavaScriptCore 0x3123372c0 WTF::ThreadCondition::timedWait(WTF::Mutex&, double)
3 JavaScriptCore 0x312dc873c WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&)
4 JavaScriptCore 0x31288921c bool WTF::Condition::waitUntilWTF::Lock(WTF::Lock&, WTF::TimeWithDynamicClockType const&)
5 JavaScriptCore 0x312dadd18 WTF::Function<void ()>::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0>::call()
6 JavaScriptCore 0x312dda024 WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*)
7 JavaScriptCore 0x312332984 WTF::wtfThreadEntryPoint(void*)
8 libsystem_pthread.dylib 0x3044b0220 _pthread_body
9 libsystem_pthread.dylib 0x3044b0110 _pthread_start

Thread 28
0 libsystem_pthread.dylib 0x3044aeb04 start_wqthread

Thread 29
0 libsystem_pthread.dylib 0x3044aeb04 start_wqthread

Thread 30
0 libsystem_pthread.dylib 0x3044aeb04 start_wqthread

Thread 31
0 libsystem_pthread.dylib 0x3044aeb04 start_wqthread

Thread 32
0 libsystem_kernel.dylib 0x304150d84 __workq_kernreturn
1 libsystem_pthread.dylib 0x3044aeeb4 _pthread_wqthread

Thread 33
0 libsystem_kernel.dylib 0x304150d84 __workq_kernreturn
1 libsystem_pthread.dylib 0x3044aeeb4 _pthread_wqthread

Thread 34
0 libsystem_kernel.dylib 0x304150d84 __workq_kernreturn
1 libsystem_pthread.dylib 0x3044aeeb4 _pthread_wqthread

EOF

Conditional rendering of the OTPublisher component does not work after the OTSession component has initially rendered

If you render the OTSession component and then choose to publish at a later time, the OTPublisher component initializes the publisher, but fails to publish because it's waiting for the sessionConnected event which has already fired.

 let publisherComponent = this.state.publish ? <OTPublisher
    style={{width: 140, height: 140}}
    properties={publishProperties}
    eventHandlers={this.publisherEvents}
/> : <View/>

render...

<OTSession style={{ flex: 1, flexDirection: 'row' }}
    apiKey={this.apiKey}
    sessionId={this.sessionId}
    token={this.token}>
    {publisherComponent}
    <OTSubscriber
        style={{width: 100, height: 100}}
    />
</OTSession>

`disconnectSession` method of the OTSession class, return `Unknown error`

I can see that the error variable on the handleError is not defined in the following code:

disconnectSession() {
    OT.disconnectSession((disconnectError) => {
      if (disconnectError) {
        this.setState({
          sessionInfo: null,
        });
      } else {
        handleError(error);
      }
    });
  }

I thinks the correct solution is:

disconnectSession() {
    OT.disconnectSession((disconnectError) => {
      if (!disconnectError) {
        this.setState({
          sessionInfo: null,
        });
      } else {
        handleError(disconnectError);
      }
    });
  }

postinstall doesn't work

iMac-Andrej:opentok-react-native andrey$ yarn install
yarn install v1.3.2
warning You are using Node "7.7.2" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0"
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > [email protected]" has unmet peer dependency "babel-core@^6.0.0 || ^7.0.0-0".
warning " > [email protected]" has incorrect peer dependency "[email protected]".
[4/4] 📃  Building fresh packages...
$ node ./scripts/postInstall
running post install linking
module.js:472
    throw err;
    ^

Error: Cannot find module '../../../package.json'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at postInstall (/Users/andrey/github/opentok-react-native/scripts/postInstall.js:7:19)
    at Object.<anonymous> (/Users/andrey/github/opentok-react-native/scripts/postInstall.js:34:2)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

[README] - Camera Resolution

The OpenTok React Native Wrapper supports the following resolutions:

  • "352x288"
  • "640x480"
  • "1280x720"

But, the readme has a typo which states: - "320x240"

[feature request] Select audio stream source

In most video/voice messaging apps out there we have an option to select where we want the audio to come from–e.g. Built-in microphone, Bluetooth device etc.

I admit I haven't thought about the implementation details yet, tbh. But initially I think of:

getAvailableAudioSources(): Array<source> - A helper function that returns an array–or an object–of available sources where the first element is always the Built-in microphone and the subsequent ones are alternatives like Bluetooth devices or similar. I haven't modeled the mentioned the source object, but it'd be something with some metadata.

This would be quite helpful:

  • I could check getAvailableAudioSources().length to know wether to show a swap option or not
  • The metadata in each item would allow me to render a UI that better explains this item

For the component, having it just as a prop of OTPublisher–just like cameraPosition–would be something great, e.g.:

audioSource: number - The preferred audio source where valid inputs are indexed values of the getAvailableAudioSources() array.

Resulting in something like:

import {OTPublisher, OTSession, OTSubscriber} from 'opentok-react-native/components';
import {getAvailableAudioSources} from 'opentok-react-native/utils';

class App extends Component {
  constructor(props) {
    super(props);

    this.state = {
      audioSource: 0, // `0` could be a default value
    };
  }

  onChangeAudioSourceButtonPress = (src) => {
    this.setState((state) => ({
      ...state,
      audioSource: src
    }));
  };

  render() {
    const audioSources = getAvailableAudioSources();
    // We could then map audioSources to any UI component–e.g. a list–that would render a list 
    // of options and then call onChangeAudioSourceButtonPress() depending on the selected one 

    return (
      <OTSession apiKey="your-api-key" sessionId="your-session-id" token="your-session-token">
        <OTPublisher
          properties={audioSource: this.state.audioSource}
          style={{ height: 100, width: 100 }}
        />
      </OTSession>
    );
  }
}

Unspecific OTSessionErrorDomain error code range

A bit of context

In my app we have the concept of roles which is applied for constraining sessions between certain roles. For example:

  • Admins have a list of all users and admins which they can use to enter a 1:1 room with a specific regular use or another admin.
  • Regular Users have just an option where they can opt in use to enter a 1:1 room with an admin.

The problem

When an admin calls another one, both OTPublisher and OTSubscriber work perfectly and we have a working session. Turns out that when we have a call between an user and an admin, the user cant't see the video coming from the admin–but the admin is able to do so.

Unfortunately, it's hard for me to post here more implementation details–but I'have been debugging for hours and the problem doesn't seem to be on the described logic itself; all the data that is passed to OTSession (token, session etc.) is fine.

One clue I have is that I get these logs–that are not thrown errors, btw–, on the console everytime it happens:

captura de tela 2018-04-24 as 19 17 40

I tried to find these on the source of this lib but I couldn't. I tried to find these on the native SDK for iOS but i admit I haven't even managed to find the OpenTok pod source, actually 😆. Nor I could reading the docs.

Details

opentok-react-native: 0.5.0
iOS: 11.2.5, 11.2.6 and 11.3.x
iPhone: SE and X(both simulator and real devices)

I know it's quite hard but if you manage to have any spare time, I'd be very happy to have a call where I could better illustrate the issue.

Yellow warnings on IOS in react-native 0.55

There are 3 yellow warnings in IOS simulator saying:
"Module OTSubscriberSwift/OTSessionManager/OTPublisherSwift requires main queue setup since it overrides init but does not implement requiresMainQueueSetup. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of."

Camera Position change while publishing

As of now, you can only set the camera position when initializing the publisher. However, since the OpenTok iOS and Android SDKs allow cameras to be toggled, the OTPublisher component should watch for cameraPosition property changes similar to publishAudio and publishVideo.

OT.destroyPublisher method

The destroyPublisher method doesn't complete the callback if the publisher is undefined. There is also a race condition where the publisher is not removed if the session has been destroyed.

OT undefined error

Having trouble today (cause yesterday this was working).
I'm not sure what's causing the error but this issue exists both on android emulator and android device.

image

and my package.json file

image

Xcode doesn't prompt option to create bridging header during iOS install

Hi,
I was following the iOS installation steps, but after adding the opentok files to my app in step 8 I was not automatically prompted to create a bridging header file (step 9). The files appear to have been added (they are visible on the project menu to the left), but I did not get the modal and don't see where else to add it.

FYI

  • I used the .xcodeworkspace file to open Xcode.
  • Xcode version 9.3.1
  • OSX version 10.13.4

I'll do some research to see whats up and provide some feedback here, but if you could provide some specific instructions that'd be awesome. Thanks!

iOS app crashs when reload on simulator

After start a call and try to refresh the simulator, the app crashs. I think is something related with application context.
On android it is not happening.

OTSubscriber renders to a black box

Nothing new for now, just registering here the progress we made on our calls and chatting.

Description

Device A - OTSubscriber and Device B - OTPublisher are black given the fact that the iOS simulator doesn't have a camera.

My point here is related to Device B - OTSubscriber: you can see Device A - OTPublisher is working properly and capturing my camera but the image in Device B - OTSubscriber is black. The audio is okay, tho–and this is what puzzles me.

This hasn't happened just in simulator; I could reproduce via Testflight on real devices.

I ran the sample app provided and tested it having the simulator and the device in the same room–here's the result:

As you can see, it works! Which is great. But then I experimented removing styles and other stuff from my view's source:

But the problem remains. Here's my render method: https://gist.github.com/ythecombinator/6595ea2ad1a4eb9e97589b59b9a97f53

As you can see, I basically just copy-pasted the whole view from the sample. Trying with no styles at all didn't work either.

Details

opentok-react-native: 0.5.0
iOS: 11.2.5, 11.2.6 and 11.3.x
iPhone: SE and X(both simulator and real devices)

FAQ

Are there any steps that you took that triggered this?

Not actually. I noticed that it didn't matter which device (A or B) connected first to the room, I got the same results–actually the error isn't intermittent as I had (mistakenly) mentioned previously; it happens on every try I make.

Lastly, are you by any chance setting the subscribeToVideo property to false in the OTSubscriber component?

Not really. All the code related to Opentok is just this: https://gist.github.com/ythecombinator/66f01fbb2623c88cb8c9f4f6a707a7fc

iOS archive/build fails: library not found for -lOpenTokReactNative

Happens on my project and a brand new project with only opentok-react-native installed.

ld: library not found for -lOpenTokReactNative
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Runs fine in the simulator but not on archive.

Currently fixed by going to Taget -> Build Phases and adding OpenTokReactNative under Target Dependencies and under Link Binary With Libraries removing libOpenTokReactNative.a and re-adding it.

streamCreated is not a supported event type [iOS]

Hi, I'm getting this exception (dismissible) when listening to the streamCreated event.

img_0392

I'm guessing this is because the publisher ID prefixed event name is not part of the declared supportedEvents() in OTSessionManager.swift

I'm not sure how to get around this so unable to raise a PR with fix. Help appreciated on this @msach22

The relevant code -

this.publisherEventHandlers = {
      streamCreated: event => {
        console.log("Publisher stream created!", event);
      },
      streamDestroyed: event => {
        console.log("Publisher stream destroyed!", event);
      }
    };
<OTSession
          apiKey={this.apiKey}
          sessionId={this.props.tokboxSessionId}
          token={this.props.tokboxPublisherToken}
        >
          <OTPublisher
            style={{
              height: this.state.videoHeight,
              width: this.state.videoWidth
            }}
            properties={{ cameraPosition: this.state.cameraPosition }}
            eventHandlers={this.publisherEventHandlers}
          />
        </OTSession>

opentok-react-native version - master

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.