Closed uendar closed 4 years ago
Hello @uendar i don't see your onRemoteStreamListener on Home screen. Your can store streams and other call data in redux
I think you should setup call listeners in top app level (e. g. Screen than will never unmount or service)
Why should i use onRemoteStreamListener on Home when i pass session and users id from home to chat ?
Because onRemoteStreamListener is only way to get remote stream, in our project we setup call listeners in service and put call data (streams, call participants peer states in redux)
Hi @banshiAnton , I am also facing the same issue after integrating video sample in my application that call gets initiated by the user and another user gets the popup for Accept and Reject the call. When another user accepts the call his webcam shows but, not the webcam of call initiator same happens with initiator that he only sees his camera and for other person loader continues.
In logs I can see this warning. Can you please help me with this?
Sending peerConnectionIceConnectionChanged
with no listeners registered.
Sending peerConnectionStateChanged
with no listeners registered.
Sending peerConnectionSignalingStateChanged
with no listeners registered.
Hi @NeenaMishra12 Did you setup the ConnectyCube.videochat.onRemoteStreamListener? Check the incoming remote stream there. You should obtain remote stream and paste it into the RTCView component.
@ccvlad ,
I am not getting how to check that. Two things you have marked as yellow in above solution that is already there in my code. Can we connect via mail so that I can share the logs with you.
@ccvlad ,
I am not getting how to check that. Two things you have marked as yellow in above solution that is already there in my code. Can we connect via mail so that I can share the logs with you.
You can share your logs here, cause we are interested to solve the problem on public.
I was trying to point you on the guide how to accept a call
import {RTCView} from 'react-native-connectycube';
//init listeners:
state = {
remoteStream: null,
userId: null
}
componentDidMount() {
// ... here must be other listeners too
ConnectyCube.videochat.onCallListener = this.onIncomingCall
ConnectyCube.videochat.onRemoteStreamListener = this.onRemoteStream
}
// you get the incoming call here and accept it
onIncomingCall = (session, extension) => {
// here show some UI with 2 buttons - accept & reject, and by accept -> run the following code:
const extension = {};
session.accept(extension);
};
// then you will get a remote stream here
onRemoteStream = (session, userID, stream) => {
// attach the remote stream to the RTCView
this.setState({remoteStream: stream, userId: userID});
};
render() {
const {userId, remoteStream} = this.state;
return (
...
<RTCView objectFit="cover" style={...} key={userId} streamURL={remoteStream.toURL()} />
...
)
}
@NeenaMishra12 sorry I didn't want to close the issue, just click a wrong button =(
@ccvlad , I am not getting how to check that. Two things you have marked as yellow in above solution that is already there in my code. Can we connect via mail so that I can share the logs with you.
You can share your logs here, cause we are interested to solve the problem on public.
I was trying to point you on the guide how to accept a call
import {RTCView} from 'react-native-connectycube'; //init listeners: state = { remoteStream: null, userId: null } componentDidMount() { // ... here must be other listeners too ConnectyCube.videochat.onCallListener = this.onIncomingCall ConnectyCube.videochat.onRemoteStreamListener = this.onRemoteStream } // you get the incoming call here and accept it onIncomingCall = (session, extension) => { // here show some UI with 2 buttons - accept & reject, and by accept -> run the following code: const extension = {}; session.accept(extension); }; // then you will get a remote stream here onRemoteStream = (session, userID, stream) => { // attach the remote stream to the RTCView this.setState({remoteStream: stream, userId: userID}); }; render() { const {userId, remoteStream} = this.state; return ( ... <RTCView objectFit="cover" style={...} key={userId} streamURL={remoteStream.toURL()} /> ... ) }
@ccvlad ,
All these code is already there in my code as I have followed the sample only. But still what I found is when we make a call in sample we get a call on onRemoteStreamListener but, in my case I am not getting call on it.
@NeenaMishra12
1) could you check console.log(remoteStream)
in the ConnectyCube.videochat.onRemoteStreamListener
?
2) also you have to return some state or null from the static getDerivedStateFromProps(props, state)
@NeenaMishra12
- could you check
console.log(remoteStream)
in theConnectyCube.videochat.onRemoteStreamListener
?- also you have to return some state or null from the
static getDerivedStateFromProps(props, state)
Hi @ccvlad , Please see below code snippet for the same together with its logs when I tried with it:
_setUpListeners() { console.log('Listeners getting called') ConnectyCube.videochat.onCallListener = this._onCallListener; ConnectyCube.videochat.onAcceptCallListener = this._onAcceptCallListener; ConnectyCube.videochat.onRejectCallListener = this._onRejectCallListener; ConnectyCube.videochat.onStopCallListener = this._onStopCallListener; ConnectyCube.videochat.onUserNotAnswerListener = this._onUserNotAnswerListener; ConnectyCube.videochat.onRemoteStreamListener = this._onRemoteStreamListener; console.log('this.remotestreams----->',this.state.remoteStreams) }
And my _onRemoteStreamListener is not getting called as that of getting called in Connectycube sample code. Also I am not getting these peerConnection warnings in the sample code which you can see in my app logs.
@ccvlad , Also just a confusion we can use Connectycube free plan for audio and video calling. Right? It is not the issue with rendering of stream.
@ccvlad , Also just a confusion we can use Connectycube free plan for audio and video calling. Right? It is not the issue with rendering of stream.
Not related. It is something with code. You can check the Videochat Sample with your creds (appId, authKey , authSecret). It should be OK.
Check like this:
_setUpListeners() {
ConnectyCube.videochat.onCallListener = this._onCallListener;
ConnectyCube.videochat.onAcceptCallListener = this._onAcceptCallListener;
ConnectyCube.videochat.onRejectCallListener = this._onRejectCallListener;
ConnectyCube.videochat.onStopCallListener = this._onStopCallListener;
ConnectyCube.videochat.onUserNotAnswerListener = this._onUserNotAnswerListener;
ConnectyCube.videochat.onRemoteStreamListener = this._onRemoteStreamListener;
}
...
_onRemoteStreamListener = (session, userID, stream) => {
console.log("onRemoteStreamListener", {session, userID, stream});
}
...
@ccvlad
_setUpListeners() {
ConnectyCube.videochat.onCallListener = this._onCallListener;
ConnectyCube.videochat.onAcceptCallListener = this._onAcceptCallListener;
ConnectyCube.videochat.onRejectCallListener = this._onRejectCallListener;
ConnectyCube.videochat.onStopCallListener = this._onStopCallListener;
ConnectyCube.videochat.onUserNotAnswerListener = this._onUserNotAnswerListener;
ConnectyCube.videochat.onRemoteStreamListener = this._onRemoteStreamListener;
}
In my code every listener does call except "ConnectyCube.videochat.onRemoteStreamListener" whereas i added it also.
Hi everyone,
I am facing an issue with connectycube. I have followed the example and fit on my project based on what i want to do. So what i am doing is that i have a multiple screen react native app and i want to receive calls from everywhere on my app. Also i have a screenof video where i redirect when i get the call from different screen. The issue is that when i do call from chat screen as the example it works fine but when i get a call from different screen and accept the call i navigate to cat screen and there i cant see the caller video. I pass data as below.
This is the Screen Home
While ChatScreen