Я много искал, но не мог найти какой-либо способ найти различные обратные вызовы в библиотеке opentok-Reaction-native , например, когда пользователь подключился, отключился, переподключился и так далее.Я даже нашел документацию для OTSession , где они описали различные события, но они не работают.Все эти события вызываются все вместе.
Видеовызов работает нормально, но я хочу выполнить различные действия в зависимости от этих событий
renderVideoView(data) {
console.log("rendering view view,, ", data);
return (
<View
style={{
flex: 1,
flexDirection: "row",
backgroundColor: R.Colors.COLOR_VIDEO_BACKGROUND
}}
>
<OTSession
ref={ref => {
this.OTSession = ref;
}}
connectionCreated={ console.log("connection created")}
connectionDestroyed={ console.log("connection destroyed")}
sessionConnected={ console.log("Client connect to a session")}
sessionDisconnected={
console.log("Client disConnect to a session")
}
sessionReconnected={() => console.log("session reconnected")}
apiKey={this.apiKey}
sessionId={data.sessionId}
token={data.token}
>
<OTSubscriber style={{ width: "100%", height: "100%" }} />
<View style={styles.publisherStyle}>
<OTPublisher
properties={{
publishAudio: this.state.publishAudio,
cameraPosition: this.state.cameraPosition,
publishVideo: this.state.publishVideo
}}
style={{ width: 90, height: 107, padding: 2 }}
/>
</View>
{this.renderViewAtCenter()}
{this.renderBottomView()}
{this.renderTopView()}
</OTSession>
</View>
);}