-
Notifications
You must be signed in to change notification settings - Fork 217
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
iOS 14.3 WKWebView #1364
Comments
+1 |
Hi @manit77 , Thanks for reporting this issue. We don't have WKWebView support in our roadmap for 2021 as of now. However, I'm curious as to why WKWebView is not working, since it is essentially a Safari window. Can you share the JavaScript console logs from your test app if possible? You can enable debug logging in the SDK by setting |
It is odd that your library works perfectly on Safari and on our system works just fine inside WKWebView. We setup small-room and recording in Twilio and our system uses Peer to Peer with turn servers enforced. Here is the file attached. This is in our log format but I should have captured all the values. I see the error around line 127. I tested this on iPhone 7 14.3, iPad Mini 14.4 with the same results. Thanks for looking at it. |
inside the log file, U is peer 1 and I is peer 2 |
We also have a big need for this and a lot of clients wanting to take client phone calls in the app using WKWebView. |
+1 |
Are you using small-room or peer to peer in your Twilio calls? |
@manjeshbhargav Surprisingly, WKWebView is quite different than Safari in iOS. In fact, Apple only added some WebRTC functionality in iOS 14.3, We've (Open Telecom Foundation) been working on: https://github.com/OpenTelecom/WKWebViewRTC and https://cocoapods.org/pods/WKWebViewRTC. We've recently updated for Looks like the Twilio example doesn't quite work fully for WKWebViewRTC either. We'll look into it. |
+1 |
Peer to peer Thks |
+1 |
…Safari). Solves the issue in the twilio-video library: twilio/twilio-video.js#1364
…Safari). Solves the issue in the twilio-video library: twilio/twilio-video.js#1364
…Safari). Solves the issue in the twilio-video library: twilio/twilio-video.js#1364
@manjeshbhargav The problem is that a function in twilio-webrtc.js project which guesses the browser by user agent does not work correctly when a web application is running inside WKWebView. |
Also need to add support for iPad. this the user agent for iPad mini. I can't copy paste it, this is typed: Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebkit/605.1.15 (KHTML, like Gecko) Mobile/15E148 |
I tested your fix on the iPad. It is working. I added iPad to the user agent check. if (/Safari|iPhone|iPad/.test(userAgent)) { Thanks! |
…iew (Safari). Solves the issue in the twilio-video library: twilio/twilio-video.js#1364
Thanks @manit77 @manjeshbhargav - could you please review and accept the pull request? |
+1 |
1 similar comment
+1 |
Any idea when this fix will be available in master and ready to use in production? |
I can confirm that this fixes the issue. I modified the CDN file to include "iPhone" in the browser test and served locally and it worked like a charm. Can someone from the Twilio team provide some feedback? (you have to love open source - these moments are great.) |
…Safari). Solves the issue in the twilio-video library: twilio/twilio-video.js#1364
…iew (Safari). Solves the issue in the twilio-video library: twilio/twilio-video.js#1364
Hi everyone, We have WKWebView support tentatively as part of our Q2 roadmap, and we will actively work on it soon. @cbxp , thanks for the PR. We will certainly incorporate it when we start working on this. Thanks, Manjesh |
This is a major blocker for one of my projects. What is the best way to get a fix temporarily? We are even thinking of switching to other Video SDK providers if this is going to take more time.. |
I've successfully used |
That is great and thanks for your prompt response. I have not used patch package before. Can you share the steps to use it pls? |
Sure! You just need to follow the instructions on their readme. But, to simplify:
"scripts": {
+ "postinstall": "patch-package"
} Note: I haven't tested this step-by-step, but that should be it as far as I remember. |
i confirm the issue has been fixed with the PR provided by @cbxp I simply replaced the index.js file in @twilio/webrtc/lib/util and it all is well across all platforms |
Browser userAgent Snifing is bad in 2021 use features detection. |
Another solution is to set the user-agent of WKWebView to contain the word "Safari", then we don't have to worry about making any changes to the Twilio code. |
Apple and the WebKit team both confirmed to me that WKWebView currently doesn't support accessing the microphone or camera in the background. So while you can hear other people talk, as soon as you background the app / lock the screen, others can no longer hear or see you. Were you able to solve this in |
@fbruckhoff this has not been tested for WKWebViewRTC as far as I know. All of the WKWebViewRTC is based on the work by @hthetiot for the Cordova project: https://github.com/cordova-rtc/cordova-plugin-iosrtc, and I'm sure he'd have a better idea what is possible here. |
For using audio and microphone while the application is minimized in background we recommend using cordova-plugin-background-mode in combination with cordova-plugin-iosrtc see sample application here: https://github.com/cordova-rtc/cordova-plugin-iosrtc-sample Using background Cordova plugin results in a red status bar with microphone in use and you can still hear remote peer audio when the application is in background. However video will not be sent to remote peer while in background. See: https://github.com/katzer/cordova-plugin-background-mode |
Hi all, Could someone confirm that this issue will address WKWebVIew whatever the platform ? Here is a trace of the issue encountered on my own: If this is not the same issue, I can create a new one. Thanks in avance for your answer |
@hthetiot Thanks for that!! |
@oanguenot yes following issue is most likely related, since when safari (via user agent) is detected to my knowledge the twilio library fix the order or m-lines. In any case if you don't have the issue after applying the user agent fix not need to create new issue in my POV.
|
@hthetiot Thanks you for your answer |
Hi Folks, The latest SDK release 2.21.0 now supports WebViews on iOS. Thanks for all of the patience! If any issues arise, please don't hesitate to open another issue with us. With that being said, I will now be closing this issue. Best, |
We've had WebRTC video calls running successfully for years on Chrome, Android, iOS and FireFox. I am testing to see if Twilio can replace some parts of our system. We are testing the twilio-video.js on iOS 14.3. The call process works as expected using Chrome, Safari. When embedding our web page inside WKWebView and we ran into some issues using Twilio. I know WKWebView is not listed as a supported browser but has anyone tested video calls in WKWebView?
When using twilio-video.js:
No JavaScript errors are reported.
Local camera and audio works using getUserMedia.
The local participant can connect to a room but no video or audio streams are sent to Twilio.
No remote audio or video streams are received from Twilio.
It appears that these events never gets triggered:
participant.on('trackSubscribed', track => trackSubscribed(track));
participant.on('trackUnsubscribed', trackUnsubscribed);
When removing twilio-video.js and using our own JavaScript WebRTC call process inside WKWebView. Everything works as expected.
When loading a third party web page such as https://janus.conf.meetecho.com/videocalltest.html inside WKWebView. Everything works as expected.
Any feedback is appreciated. Thanks.
Update:
I did find oner error during the negotiation process.
Calling setRemoteDescription with an RTCSessionDescription of type "answer" failed with the error "Failed to set remote answer sdp: The order of m-lines in answer doesn't match order in offer. Rejecting answer.".
The text was updated successfully, but these errors were encountered: