Flutter - Jitsi Meet Call backs in inAppWebView

1,667

Sorry to say, but you can't access such features through webview, because when you access thorough webview it's similar to open the site on the browser as a user. You can use Jitsi SDK or plugins which allow you to modify the settings.

Suggestion: Use the jitsi meet plugin which you had used before it already has such features as which you want:

onConferenceWillJoin    Meeting is loading.
onConferenceJoined  User has joined meeting.
onConferenceTerminated  User has exited the conference.
onPictureInPictureWillEnter User entered PIP mode.
onPictureInPictureTerminated    User exited PIP mode.
onError Error has occurred with listening to meeting events.

But there is no feature for participant information. But you can achieve this all by hosting your own jitsi server, which would allow you to either customize it or directly have such settings on your custom domain so that on the app you can simply access through webview.

I have used this plugin for a long time and made an app published on the play store. Check that out do you something similar to that? app name Just Meet. If you want like that then I can help you out with my repo.

Share:
1,667
Sumithra N
Author by

Sumithra N

Updated on December 29, 2022

Comments

  • Sumithra N
    Sumithra N over 1 year

    I need to integrate Jitsi Meet in webview for our flutter application. Initially I used the following jitsi-meet plugin "https://pub.dev/packages/jitsi_meet" but unfortunately had to switch to InAppwebview plugin "https://pub.dev/packages/flutter_inappwebview" because of missing features such as jitsi reconnection after internet drop and participant information in jitsi-meet plugin. I have successfully integrated the jitsi in webview but have no idea how to include jitsi callbacks like onConferenceJoined, onParticipantLeft etc. Any help would be much appreciated

    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://meet.jit.si/hello",
                  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);
                  }),
            ),
          ),
        ])));
    }
    }