Created
March 23, 2020 08:49
-
-
Save enricop89/5a4ef01ef4246b23e0d7ff29cac27da9 to your computer and use it in GitHub Desktop.
React-native - Example of proxyURL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { View } from 'react-native'; | |
import { OTSession, OTPublisher, OTSubscriber } from 'opentok-react-native'; | |
export default class App extends Component { | |
constructor(props) { | |
super(props); | |
this.apiKey = ''; | |
this.sessionId = ''; | |
this.token = ''; | |
} | |
render() { | |
return ( | |
<View style={{ flex: 1, flexDirection: 'row' }}> | |
<OTSession apiKey={this.apiKey} sessionId={this.sessionId} token={this.token} | |
options={{ proxyUrl: "https://your-proxy-url.com" }}> | |
<OTPublisher style={{ width: 100, height: 100 }} /> | |
<OTSubscriber style={{ width: 100, height: 100 }} /> | |
</OTSession> | |
</View> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment