Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use this plugin with peerjs #86

Open
mickytroxxy opened this issue Oct 31, 2019 · 7 comments
Open

How to use this plugin with peerjs #86

mickytroxxy opened this issue Oct 31, 2019 · 7 comments

Comments

@mickytroxxy
Copy link

Im calling my real device from my laptop using peerjs. on.call function i use cordavaCall plugin on my device and my phone can ring well and i can answer the incoming call. How do i pass the stream to cordovaCall plugin so that i can hear or see the remote video? Right now i can't hear anything and i believe this is because im not passing the remote media stream. How do i pass it please. I use peerjs.

@mickytroxxy
Copy link
Author

does this work when i call from pc then use this plugin on my real device to answer calls?

@Bobisback
Copy link

I was using peerjs at first as well, but found it did not work correctly for ios. So switched to iosrtc combined with my own implementation of peerjs. Aka I basically wrote my own version of peerjs. This was like 1-2years ago though so things might have changed with peerjs.

@mehthaf
Copy link

mehthaf commented Jun 6, 2020

Im calling my real device from my laptop using peerjs. on.call function i use cordavaCall plugin on my device and my phone can ring well and i can answer the incoming call. How do i pass the stream to cordovaCall plugin so that i can hear or see the remote video? Right now i can't hear anything and i believe this is because im not passing the remote media stream. How do i pass it please. I use peerjs.

kindly share your code with us how to implement cordova call with peerjs

@mattkhaw
Copy link

@mickytroxxy @mehthaf Ok, I know this issue is from 2019, but still, I'm gonna put in my 2 cents on this.

Direct replying to the issue where you can't see or hear the stream from remote, you just can't pass the stream into CordovaCall plugin. It just doesn't work that way. That's what peerjs is for. Peerjs handles the data exchange and the signals for video call.

What you need to do is, when the receiver receives the call event, just call receiveCall to display the UI first. If the receiver answers the call, then just answer the call. Of course, before you do that, you have to hook the stream event first, so that you can actually display the stream.

On caller side, it is pretty straightforward. Just call sendCall to lock your phone so that it is actually calling, then hook the stream event first before actually using peerjs call method.

I do believe this is the entire workflow on exactly how video call should be. I won't go further since I didn't use peerjs to do this but the basic idea is exactly the same. Hope it helps.

@danielehrhardt
Copy link

You say "Just call sendCall" but how to call the function when the App is closed? Over a Push?

I am very interested in this call Solution here. Does anyone want to share his code?
I am also open to pay something.

Send me a Message (WhatsApp or So) +4915161018772

@Bobisback
Copy link

So the latest version of ios broke cordovacall with push notifications. Basically to get this to work with voip push notifications, this plugin had to be combined with the cordova voip push plugin. There is a huge thread about it I started. Someone combined the two plugins to get it to work with ios 13. He code is in that conversation.

@mattkhaw
Copy link

@danielehrhardt The sendCall function is just to lock the caller's phone from making another call. Basically, putting the caller's phone in engaged state. If not mistaken, CordovaCall doesn't have a UI for this. You need to create this on your own.

As for app's closed state, this have to be done using Background Notifications for Android and PushKit for iOS. As @Bobisback stated, for iOS, there's no way around it other than modifying the current plugin to include PushKit functionality. As for Android, no modifications to the plugin is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants