opentok-react-native | OpenTok React Native - a library for OpenTok iOS | iOS library
kandi X-RAY | opentok-react-native Summary
kandi X-RAY | opentok-react-native Summary
OpenTok React Native - a library for OpenTok iOS and Android SDKs
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Sends an error to the server
- Called when the subscriber has received an error
- Sends an error to the publisher
- Resume the audio state
- Register btn - set receivers for the current headset state
- Called when subscriber is disconnected
- Called when a session is disconnected
- Initializes the renderer
- Register phone state listener
- Initialize a session
- Sanitizes server list
- Called when video is disabled
- Called when video is enabled
- Initializes a publisher
- Restore the audio after the device has been connected
- Destroys the audio rendering
- Destroys the capture
- Publish a session
- Subscribe to a stream
- Initializes the recorder
- Set the output mode
- Destroys a publisher
- Removes a subscriber
- Send a signal to all connected sessions
- Event handler for video dimensions changed
- Called when a Stream is destroyed
opentok-react-native Key Features
opentok-react-native Examples and Code Snippets
Community Discussions
Trending Discussions on opentok-react-native
QUESTION
I'm trying to implement the OpenTok Lib for react-native but I'm facing some issues that I can't figured it out yet. First one, and I think the most important, is that I can't connect as a Subscriber to a session without crashing the App, that occurs only on android devices, and for that I can't see if it's working the connections between two phones.
What am I doing wrong?
Appointment
...ANSWER
Answered 2019-Apr-09 at 16:47Actually, the problem was that I was trying to stream video from a subscriber, which can't be done in this way....
The answer is in here: https://github.com/opentok/opentok-react-native/issues/239
QUESTION
I'm trying to build an app with opentok-react-native library.
When the app is running, the publisher component becomes a black square and the subscriber component shows my camera video.
In the logs I can see that the stream is created, with a stream ID and apparently is working. But when I go to my Tokbox account I can't see any data on my dashboard:
Here is my current code: https://github.com/victor0402/opentok-demo
The important part is:
...ANSWER
Answered 2019-Mar-08 at 18:23TokBox Developer Evangelist here.
The usage metrics take about 24 hours to populate in the dashboard which is why you're not seeing them immediately.
I also reviewed the code you shared and it looks like your setting the streamProperties
object in the streamCreated
callback for OTPublisher
. Please note that the streamCreated
event for the publisher will only fire when your publisher starts to publish. Since you're using the streamProperties
to set properties for the subscriber, you should be setting this data in the streamCreated
event callback for OTSession
because that's dispatched when a new stream (other than your own) is created in a session. Your code would then look something like this:
QUESTION
I have searched a lot but couldn't find any way to find various callbacks in opentok-react-native library like when user has connected, disconnected, reconnecting and so on. I even found the documentation for OTSession where they have described the various events, but these are not working. These all events get called all together.
Video call is working fine, but I want to perform various action depending upon these events
...ANSWER
Answered 2019-Feb-04 at 17:32TokBox Developer Evangelist here.
To set the event listeners via the OTSession
component, please use the eventHandlers
prop like so:
QUESTION
I'm trying to get the name of the publisher to display on top of the video stream (on both the Publisher's and Subscriber's ends) using the OpenTok React Native package.
According to the documentation for the OTPublisher component, it should be just a matter of passing in the name
key as one of the properties.
I've tried adding name to the properties and passing that through to the OTPublisher component, but it won't show up on the Publisher or the Subscriber. Do I need to do something else?
Here is the sample code I'm working with:
...ANSWER
Answered 2019-Jan-25 at 18:11TokBox Developer Evangelist here.
The OpenTok React Native library renders native views that are powered by the OpenTok iOS and Android SDKs. These mobile SDKs do not support the rendering of the video with the name
superimposed on top of it, that is currently only available using the OpenTok JS SDK.
If you subscribe to the same session on the web (you can test it using the OpenTok Playground tool), you would see that setting the name property works.
QUESTION
I'm making a voice call in ReactNative
App
with Opentok ReactNaitve SDK
.
Does anyone know how I can switch between earpiece and speaker (mobile phone) when subscribing to a audio streaming?
...ANSWER
Answered 2019-Jan-04 at 17:53I have written native functions for both platforms on this issue. Currently, I haven't figured out a better way to resolve it, so you can try my way.
I think you already knew How to write a native module for both platforms, so I will only give you the main stuff.
For iOS:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install opentok-react-native
In you terminal, change into the ios directory of your React Native project.
Create a pod file by running: pod init.
Now run, pod install
After installing the OpenTok iOS SDK, change into your root directory of your project.
Open <YourProjectName>.xcworkspace contents in XCode. This file can be found in the ios folder of your React Native project.
Click File and New File
Add an empty swift file to your project: You can name this file anything i.e: OTInstall.swift. This is done to set some flags in XCode so the Swift code can be used.
Click Create Bridging Header when you're prompted with the following modal: Would you like to configure an Objective-C bridging header?
Ensure you have enabled both camera and microphone usage by adding the following entries to your Info.plist file:
Go to Target
Click on Build Phases
Under the Link Binary With Libraries section, remove the libOpenTokReactNative.a and add it again
In your terminal, change into your project directory. If you have already run react-native link opentok-react-native for the iOS installation, please skip this step. Open your Android project in Android Studio.
In your terminal, change into your project directory.
If you have already run react-native link opentok-react-native for the iOS installation, please skip this step. Run react-native link opentok-react-native
Open your Android project in Android Studio.
Add the following to your project build.gradle file:
Sync Gradle
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.
As for the older Android devices, ensure you add camera and audio permissions to your AndroidManifest.xml file:
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page