/** * Sample React Native App * https://github.com/facebook/react-native * * @format * @flow */ import React, {Component} from 'react'; import { Platform, StyleSheet, Text, View, TouchableOpacity, TextInput } from 'react-native'; import AgoraRTCView from './components/agora'; const instructions = Platform.select({ ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu', android: 'Double tap R on your keyboard to reload,\n' + 'Shake or press menu button for dev menu', }); const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 5, }, button: { height: 44, paddingHorizontal:20, backgroundColor:'#6A71DD', borderRadius:10, justifyContent:'center', alignItems:'center', marginTop: 10 } }); type Props = {}; export default class App extends Component { constructor(props) { super(props); this.state = { showLive: false, error: undefined, channelProfile: 1, videoProfile: 40, clientRole: 1, swapWidthAndHeight: true, channelName: 'defaultChannel' }; } joinChannel = () => { this.setState({ showLive: true }) } onCancel = (error) => { console.log("[error]", error); this.setState({ showLive: false, error }) } render() { if (this.state.showLive) { return (); } return ( {this.state.error && Error Message: {error}} { let matched = text.match(/\d+/g) && text.match(/\d+/g)[0] if (matched) { this.setState({channelProfile: +matched}) } } } /> { let matched = text.match(/\d+/g) && text.match(/\d+/g)[0] if (matched) { this.setState({videoProfile: +matched}) } } } /> { let matched = text.match(/\d+/g) && text.match(/\d+/g)[0] if (matched) { this.setState({clientRole: +matched}) } } } /> this.setState({channelName: text})} /> join room ); } }