blackuy / react-native-twilio-video-webrtc

Twilio Video (WebRTC) for React Native
https://www.twilio.com/docs/video
MIT License
608 stars 403 forks source link

ref.current.connect is not a function #512

Open gheorghe96 opened 3 years ago

gheorghe96 commented 3 years ago

Steps to reproduce

constructor(props) { super(props); this.twilioRef = React.createRef(); }

<TwilioVideo ref={this.twilioRef} onRoomDidConnect={ this._onRoomDidConnect } onRoomDidDisconnect={ this._onRoomDidDisconnect } onRoomDidFailToConnect= { this._onRoomDidFailToConnect } onParticipantAddedVideoTrack={ this._onParticipantAddedVideoTrack } onParticipantRemovedVideoTrack= { this._onParticipantRemovedVideoTrack }/>

then in other method when call:

this.twilioRef.current.connect({ roomName: 'testRoom', accessToken: token });

get this:

Screenshot 2021-07-01 at 11 54 41

Environment

react-native-twilio-video-webrtc

"react-native-twilio-video-webrtc": "git+https://github.com/blackuy/react-native-twilio-video-webrtc.git",

slycoder commented 3 years ago

Do you have a little more code you could share? It's hard to identify the problem just from the snippet you've provided.

RehanAhmed-dotcom commented 1 year ago

I am also having the same TypeError: undefined is not a function(near '...twilioRef.current.connect...'). Does any one found any solution?