Build live video mobile apps with OpenTok React Native

OpenTok React Native for live video mobile apps

Over the past few weeks, I’ve been working on OpenTok React Native. As the name suggests, it’s a React Native library for OpenTok. As I work with developers at hackathons and other events, I’ve had lots of questions about React Native and OpenTok. So on April 11th I’ll be hosting a webinar where I’ll build iOS and Android applications with live video using OpenTok and React Native. 

Watch Webinar Replay

Adding live video to mobile apps

Using this OpenTok Labs solution, you can easily add live video to your iOS and Android applications by using just a few JSX components.

<OTSession apiKey='your-api-key' sessionId='your-session-id' token='your-token'>
     <OTPublisher style={{ width: 100, height: 100 }} />
     <OTSubscriber style={{ width: 100, height: 100 }} />

One of the benefits of using OpenTok React Native is that the API is very similar to OpenTok React, a web component for adding live video. This means that you don’t have to learn new APIs. In fact, you can reuse the majority of the OpenTok code between your web and mobile applications.

What is React Native?

React Native is a framework, backed by Facebook, that allows you to build native mobile applications using JavaScript and React. The benefit of using React Native is that you build a native application, as opposed to a hybrid application when you use other frameworks such as Cordova, Ionic, etc.

React Native comes with native APIs that allow developers to leverage hardware features and fundamental native views using JavaScript. With this in mind, we wanted to explore an OpenTok solution so React developers can add live video to their mobile applications quickly and easily.

OpenTok React Native Library

This library is written in JavaScript, Swift, and Java. We used Swift and Java so we could build on top of the existing OpenTok iOS and Android SDKs. This allowed us to leverage the SDKs and only write bridges so developers could use the supported libraries under the hood.

OpenTok React Native Samples

If you’re interested in using OpenTok React Native, take our OpenTok React Native Samples repo for a spin. In this repo, you’ll find the following sample applications:

These sample applications will walk you through how to publish, subscribe to multiple streams, and use the Signaling API to create a text chat.

This is an OpenTok Labs library. We highly encourage you to send pull requests and file issues so we can improve the library together. If you would like to contribute to the library or the samples, please see the repo contribution guidelines.

If you’re interested in learning more about OpenTok React Native, watch the replay of  my webinar on April 11th.

Watch Webinar Replay