proposals
proposals copied to clipboard
WebRTC
Plugin Request
Name: WebRTC
Package: @capacitor-community/webrtc
Platform(s)
iOS
Existing Solutions
Description
Ability to access MediaDevices.getUserMedia() natively for iOS to work with WebRTC.
Original request: https://github.com/ionic-team/capacitor/issues/2944
This would be nice!
👍
@phairow Upvote the original post so people can sort by it.
Sure thing
it would be awesome to have this pugin
As far as I can tell, without this there is no way to use getUserMedia with capacitor on iOS, correct? This would be great to have!
It is not just getUserMedia(). I am also getting an error with navigator.mediaDevices.addEventListener
Yeah navigator.mediaDevices does not exist, so all of its methods are not usable currently.
Interesting. The same code works fine in a browser environment or maybe it is not called in a browser environment. When deploying the code mobile, I get the error TypeError: undefined is not an object (evaluating 'navigator.mediaDevices.addEventListener'). Could you please point me to the link regarding navigator.mediaDevices that it does not exist? The code is part of the AWS Chime library so that I can report?
@bizready it's a limitation of iOS. This issue here is the only possible fix. It has to be supported in Capacitor since iOS does not have it by default. There is a Cordova plugin, but it doesn't work with Capacitor. https://github.com/cordova-rtc/cordova-plugin-iosrtc
Thanks @rwwagner90. I am experimenting with using https://github.com/cordova-rtc/cordova-plugin-iosrtc and it is very promising!
@bizready as I mentioned, that Cordova plugin does not work with Capacitor.
@rwwagner90 - I am using Quasar framework (one code base for web, mobile, and desktop). I can easily build code for Cordova or Capacitor. That way, I am in a good situation!
@bizready sure, but then you are not using capacitor and this feature request is for capacitor. Those of us using capacitor are still stuck.
For the time being (POC), I am ok in using Cordova. I want to use Capacitor. I do know that Capacitor can use Cordova plugins, that does not mean that isoRTC can be readily used in Capacitor. I am thinking that with some custom code, may be isoRTC can be used in Capacitor until we have Capacitor specific plugin?
There is actually a bug filed in the webkit bugtracker: https://bugs.webkit.org/show_bug.cgi?id=208667
If you want to push Apple to fix that issue you can follow the instructions in the comments to show Apple that you are affected by this missing feature.
I am thinking that with some custom code, may be isoRTC can be used in Capacitor until we have Capacitor specific plugin?
I saw a comment somewhere from the Capacitor team saying it won't work. I forget where I saw it.
I have it(iosRTC) working with capacitor. Only odd issue is having to manage the binary within node_modules folder so it gets picked up on sync.
@phairow how did you get it working?
https://github.com/phairow/pubnubchatrcionic You can see my repo. You will see most of the settings I had to do documented in custom/publish.md. The final step was to disable bitcode for the app.
This plugin would be nice!
In the era of Zoom and telemedicine the WebRTC plugin is really necessary.
navigator.mediaDevices.getUserMedia is implemented in iOS 14.3 beta according to this: https://webkit.org/blog/11353/mediarecorder-api/
Hi, Is there a way to get a video stream (MediaStream) from Capacitor Camera.getPhoto( ) ?
@dwieeb From my current tests it seems that navigator.mediaDevices.getUserMedia is indeed implemented in iOS 14.3. and my app correctly asks for the Camera permissions. But getUserMedia still fails with NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.
According to https://bugs.webkit.org/show_bug.cgi?id=208667 the reason is that capacitor uses the custom URL scheme capacitor://, I tried to change it do https://localhost:3000 via capacitor.config.json but while I was able to change the host to localhost:3000 the scheme capacitor:// does not seem be changeable on iOS.
@7freaks-otte Looks like that's being addressed: https://github.com/WebKit/WebKit/commit/ff60f0a9b3a455b56adb95dbab14d404cb024152
Hello,
I'm using ionic 5 with capacitor and angular9. and i have the same problem as @7freaks-otte. When i build the app on ios, I reveice an "notallowederror" at the line navigation.getUsermedia. If i understand well, it doesn't work natively and any plugin works with capacitor.
So today there is no way today to get the stream with capacitor ?
Hello,
I'm using ionic 5 with capacitor and angular9. and i have the same problem as @7freaks-otte. When i build the app on ios, I reveice an "notallowederror" at the line navigation.getUsermedia. If i understand well, it doesn't work natively and any plugin works with capacitor.
So today there is no way today to get the stream with capacitor ?
https://github.com/cordova-rtc/cordova-plugin-iosrtc
Doest https://github.com/cordova-rtc/cordova-plugin-iosrtc work with capacitor ?