-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add support for WebRTC on iOS (WKWebView) #200
Comments
Is this task added to plans? |
@marinat at the moment there aren't any plans about it. Also, another problem is that I don't have any real iPhone/iPad on where I can test (on iOS Simulator it won't work!). |
When will the WebRTC support come to WkWbeView Folks? This is hurting a lot in our inability to record music inside WkWebView. |
Hey everyone, we wrote an open source swift shim for the missing WebRTC functionality for WKWebView: https://github.com/OpenTelecom/WKWebViewRTC Big thanks to the Cordova project! |
@noahmehl Thanks! Is there a way to import it as a dependency for iOS or should I clone/fork it? |
@pichillilorenzo were hoping to make it into a cocoa pod, but for the moment, you would just have to clone it. |
@marinat did you give permission to the camera and microphone? I didn't test it, also because I don't have any real Apple smartphone/tablet. |
@pichillilorenzo I gave permission to the microphone, but for camera permission unfortunately I got error dialog with empty description |
@marinat we did not test video or the camera. I’m sure it could be done, but would need sponsorship. |
@noahmehl should i create an issue in your project? |
@marinat absolutely, feel free. I just want to be honest, that we currently have no immediate plans to update for that. |
@marinat @pichillilorenzo the repo is now a cocoa pod. The original code is in a branch called |
@noahmehl So, if the camera is not working, I'm sorry but I won't add/use this dependency. Let me know for any update about it! Thanks again! |
@pichillilorenzo I'm totally fine with this. I imagine that it will get updated for video, it's just that, in life, all things are limited. If someone in the community wants to contribute/sponsor, this issue is here for reference. If we update it for video, I will update my comments here as well. There is another concern with this implementation: which is bitcode has to be disabled. If we address this as well, I will comment here. If this gets resolved in the OS, then this will be moot. Either way, the pod is available for people if they want to implement themselves (as wrapping wkwebview is trivial). |
@pichillilorenzo and @noahmehl
|
@breebee feel free to email me at: [email protected]. |
@breebee Flutter desktop target support is not yet available because PlatformView support is not yet implemented by the Flutter team, unfortunately! See: |
@noahmehl just write [ time / price / paypal email ] and if I can afford to help inappwebview you will receive the payment in full trust. Thank you |
@breebee I'm not discussing a price publicly. The only thing we are interested in working on is updating the shim to support video. It's likely to happen else wise, I just can't give a time frame. |
you can't post a non-working implementation of a library. You're costing people wasted time. At least put the known bugs or issues in the read me page. |
anyone got it to work ? please tell me someone did |
Good news! We are extending the Pod for video support. I will update everyone when we have something. |
How long do you think it will take to add ? |
We're hoping for mid-December. |
@noahmehl Did you update the pod to the latest version of cordova-plugin-iosrtc ? |
@MeherBa we haven't done anything yet. We do intend to update from cordova-plugin-iosrtc also. |
web rtc is working in iOS 14.3. but inside inapp_webview, the page https://appr.tc is not loading on android side as expected, and on iOS side the call view/screen is not layout as it is layout in safari. |
@Faiizii I think they only added getUserMedia(): https://webkit.org/blog/11353/mediarecorder-api/ I don't think they added the rest. That being said, https://github.com/OpenTelecom/WKWebViewRTC has been updated to version 0.3.0 which should now support audio and video. We used: https://cordova-rtc.github.io/cordova-plugin-iosrtc-sample/index.html as the test. @MeherBa @skillgamer @Manit-Chanthavong @breebee @pichillilorenzo ^^ Also, we're still actively working on it, especially against the twilio options. If you find anything please open an issue on the repo. |
@noahmehl Thank you for the reply, i got this error |
Any updates for this issue ? Bcz i've this problem too. Thank you ^^ |
Just updated to iOS 14.3, and now webRTC is working in WKWebView 🙂 |
@mixdesign thanks for information ^^ |
is there an example for wkwebview (with IOS 14.3) with flutter_inappwebview ? same as the one we have for android with all permission implementation : https://medium.com/flutter-community/inappwebview-the-real-power-of-webviews-in-flutter-c6d52374209d |
@noahmehl Is there a way to add it with cocoapods without setting the plugin minimum ios platform version to 11.0? I mean something like this: public class InAppWebView: WKWebView, .... {
if #available(iOS 11, *) {
// enable WebRTC, add WKWebViewRTC custom user scripts, etc.
}
} |
@pichillilorenzo I think the minimum version in the pod is probably arbitrary at the moment. Honestly, we have no way of testing old versions (as Apple pretty much makes it impossible). What is the minimum version your app support? Separately, the newest version on of the pod: 0.4.0 should handle any version from 11-14.3+. Even though some WebRTC features were added in WKWebView in 14.3, not all features have been added, etc. |
I'm not talking about a specific iOS App, but about the flutter plugin. My Plugin supports ios 8.0+.
There is no problem for me with that. It's ok to enable WebRTC to iOS 11.0+, but the problem is that when I add it to my cocoapods dependencies and run
That's obvious because the minimum ios version for if #available(iOS 11, *) {
// enable WebRTC, add WKWebViewRTC custom user scripts, etc.
} Is it possible? Thanks again! |
Ok, I solved it by myself using a custom modification of https://github.com/cordova-rtc/cordova-plugin-iosrtc to make it work on my plugin and, also, I solved the problem related to the Google WebRTC minimum ios version (11.0) adding a specific However, @noahmehl I tried also your |
@pichillilorenzo thanks for the update. And we will look into the memory issue. I really appreciate the help! |
After hours of tests using the cordova plugin iosrtc swift code workaround, I decided to not use it because there are a lot of limitations in general. For example, one limitation is that the streams are not really part of the webpage document, they are just other native For cordova/ionic apps, probably the cordova plugin iosrtc works well because it is all wrapped inside a single I have just found that the iOS UsageTo make it work with this plugin, you need to set the cross-platform option initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
mediaPlaybackRequiresUserGesture: false,
),
android: AndroidInAppWebViewOptions(
useHybridComposition: true
),
ios: IOSInAppWebViewOptions(
allowsInlineMediaPlayback: true,
)
), Note that on iOS, to be able to play video inline, the <video autoplay playsinline src="..."></video> Also, you need to request import 'package:permission_handler/permission_handler.dart';
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
await Permission.camera.request();
await Permission.microphone.request();
runApp(MyApp());
} In your <key>NSMicrophoneUsageDescription</key>
<string>Flutter requires acess to microphone.</string>
<key>NSCameraUsageDescription</key>
<string>Flutter requires acess to camera.</string> If you open this file In Xcode, then the To test it, you can try to visit https://appr.tc/. |
The named parameter 'useHybridComposition' isn't defined. I am using |
|
@Faiizii |
|
@Faiizii It seems there are some html/css issues on https://appr.tc/ website if you use iOS. So, it is not related to my plugin. |
Every time you open a web page, you need to reauthorize it |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue. |
WKWebView
doesn't support WebRTC natively:Useful links:
How to solve this problem?
This is the unique solution I have found (this requires a lot of work).
The text was updated successfully, but these errors were encountered: