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

Web view not asking for Audio (Microphone) and Video (Camera) permissions when calling a teams meeting link #323

Closed
Vishruthd92 opened this issue Apr 20, 2020 · 6 comments

Comments

@Vishruthd92
Copy link

I am trying to call a Microsoft Teams meeting from the meeting link in flutter inappwebview, I am able to render the webpage but I am not able to click on Allow as per the screenshot below to allow audio and video in teams meeting. Can you please help?

Teams_Meeting_screenshot

@mankeomorakort
Copy link

I want to access video and microphone via html 5, but it doesn't have permission. any idea please?

@pichillilorenzo
Copy link
Owner

To request permission, you need to use other plugins, such as permission_handler. Asking permission to use video and/or microphone is out of the scope of the WebView.

@e2haining
Copy link

why it is out of the scope? does it mean the html5 Microphone and video will not work in this webview plugin?

@pichillilorenzo
Copy link
Owner

pichillilorenzo commented May 17, 2020

@e2haining Yes, they will work, but you need to ask permission. To ask permission, you can use the permission_handler plugin.
It doesn't make any sense I reinvent the wheel for just asking, for example, camera and microphone. There is already a plugin that does it.

However, my plugin also has the androidOnPermissionRequest for Android, that is an event fired when the WebView is requesting permission to access the specified resources (that is the Android native WebChromeClient.onPermissionRequest event).

An example of WebRTC on Android is:

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 {
  WidgetsFlutterBinding.ensureInitialized();

  await Permission.camera.request();
  await Permission.microphone.request();

  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: InAppWebViewPage()
    );
  }
}

class InAppWebViewPage extends StatefulWidget {
  @override
  _InAppWebViewPageState createState() => new _InAppWebViewPageState();
}

class _InAppWebViewPageState extends State<InAppWebViewPage> {
  InAppWebViewController _webViewController;

  @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",
                      initialOptions: InAppWebViewGroupOptions(
                        crossPlatform: InAppWebViewOptions(
                          mediaPlaybackRequiresUserGesture: false,
                          debuggingEnabled: true,
                        ),
                      ),
                      onWebViewCreated: (InAppWebViewController controller) {
                        _webViewController = controller;
                      },
                      androidOnPermissionRequest: (InAppWebViewController controller, String origin, List<String> resources) async {
                        return PermissionRequestResponse(resources: resources, action: PermissionRequestResponseAction.GRANT);
                      }
                  ),
                ),
              ),
            ]))
    );
  }
}

This example uses https://appr.tc/ to test WebRTC feature. It's a video chat demo app based on WebRTC (https://github.com/webrtc/apprtc).

Also, for Android, in the AndroidManifest.xml, you need to add these permissions:

<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" />

@shpy2001
Copy link

I am trying to call a Microsoft Teams meeting from the meeting link in flutter inappwebview, I am able to render the webpage but I am not able to click on Allow as per the screenshot below to allow audio and video in teams meeting. Can you please help?

Teams_Meeting_screenshot

Hi.
Pls, can you share the url, code ? I try to show ms teams meeting in flutter inappwebview but i got err_unknown_url_scheme.
I use "copy meeting link" from host of meeting, and get url like this : https://teams.live.com/meet/000000000000

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants