-
Notifications
You must be signed in to change notification settings - Fork 936
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
WebView WebRTC #138
Comments
what do you mean ? additional permission on the webview or the app ? (Android manifest) |
Webview : I am getting the following error . |
add this to your Android manifest. <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/> |
I have added still getting the same error. |
I see, probably related to https://stackoverflow.com/questions/38917751/webview-webrtc-not-working |
Yes.. |
Hello. |
You can try my plugin flutter_inappbrowser (EDIT: it has been renamed to flutter_inappwebview). To request permissions about the camera and microphone, you can use the permission_handler plugin. An example of using WebRTC that works on Android: import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:permission_handler/permission_handler.dart';
Future main() async {
await PermissionHandler().requestPermissions([PermissionGroup.camera, PermissionGroup.microphone]);
runApp(new MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => new _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: InAppWebViewPage()
);
}
}
class InAppWebViewPage extends StatefulWidget {
@override
_InAppWebViewPageState createState() => new _InAppWebViewPageState();
}
class _InAppWebViewPageState extends State<InAppWebViewPage> {
InAppWebViewController webView;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("InAppWebView")
),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: Container(
child: InAppWebView(
initialUrl: "https://appr.tc/r/158489234",
initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
mediaPlaybackRequiresUserGesture: false,
debuggingEnabled: true,
),
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
},
onLoadStop: (InAppWebViewController controller, String url) {
},
onPermissionRequest: (InAppWebViewController controller, String origin, List<String> resources) async {
print(origin);
print(resources);
return PermissionRequestResponse(resources: resources, action: PermissionRequestResponseAction.GRANT);
}
),
),
),
]))
);
}
} This example uses the room Also, you need to add these permissions in the <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.VIDEO_CAPTURE" />
<uses-permission android:name="android.permission.AUDIO_CAPTURE" /> |
Thank you for your answer. But the iPhone didn't open the camera.
Is there anything else I need to set up? |
@Dopble2k I opened an issue about that with some explanations and useful links: pichillilorenzo/flutter_inappwebview#200. You can follow that issue. However, just to inform you, my plugin has been renamed to flutter_inappwebview. |
Solved My Problem. To anyone who is still struggling. it's because webview doesn't support file attribute. So use this package Flutter WebView Pro |
I have the same problem while developing for android。The solution is as follows
The test works, hope it helps |
I am having an issue using @pichillilorenzo your plugin (for using camera and microphone, camera works alright on both platforms). It works like a charm on IOS but I have spent the last few days trying to get it to work on Android. My permissions are intact too in the manifest file.
Please I need help as to what I might be doing wrong or it will be nice if someone can point me to a version that worked for them. The issue is actually with microphone permissions. because i tested for camera (with https://webcamtests.com/ ) and it worked well on both. Please this is kind of urgent. |
I am trying to show video call in webview. It requires additional permission.
The text was updated successfully, but these errors were encountered: