A WebRTC module for React Native that works with Temasys Skylink Web SDK 2.x.
- Support iOS / Android.
- Support Video / Audio / Data Channels.
NOTE for Expo users: this plugin doesn't work unless you eject.
temasys-react-native-webrtc | WebRTC Version | arch(ios) | arch(android) | notes |
---|---|---|---|---|
master | M75 | x86_64 i386 armv7 arm64 |
armeabi-v7a arm64-v8a x86 x86_64 |
Please see wiki page about revision history.
Now, you can use WebRTC like in browser.
In your index.ios.js
/index.android.js
, you can require WebRTC to import RTCPeerConnection, RTCSessionDescription, etc.
import {
RTCPeerConnection,
RTCIceCandidate,
RTCSessionDescription,
RTCView,
MediaStream,
MediaStreamTrack,
mediaDevices,
} from 'temasys-react-native-webrtc';
Instructions on using this module with Temasys Web SDK can be found here.
Rendering of video stream should be implemented the React way.
Rendering RTCView.
<RTCView streamURL={this.state.stream.toURL()}/>
Name | Type | Default | Description |
---|---|---|---|
mirror | boolean | false | Indicates whether the video specified by "streamURL" should be mirrored during rendering. Commonly, applications choose to mirror theuser-facing camera. |
objectFit | string | 'contain' | Can be contain or cover |
streamURL | string | '' | This is mandatory |
zOrder | number | 0 | Similarly to zIndex |
This function allows to switch the front / back cameras in a video track on the fly, without the need for adding / removing tracks or renegotiating.
Starting with version 1.67, when setting a local video track's enabled state to
false
, the camera will be closed, but the track will remain alive. Setting
it back to true
will re-enable the camera.
Source: react-native-webrtc@1.75.3
This repository was originally created by Wan Huang Yang.