lennhv / jitsi_meet_plugin Goto Github PK
View Code? Open in Web Editor NEWA `gunschu / jitsi_meet` copy to implement web plugin
License: MIT License
A `gunschu / jitsi_meet` copy to implement web plugin
License: MIT License
Could not find a file named "jitsi_meet_plugin/jitsi_meet_web/pubspec.yaml" in git://github.com/lennhv/jitsi_meet_plugin.git 1f2b36b.
I assume it should be
jitsi_meet_external_api.dart without the extra i
JitsiMeetingOptions: JitsiMeetingOptions{room: plugintestroom, serverURL: https://meet.jit.si, subject: My Plugin Test Meeting, token: null, audioMuted: true, audioOnly: true, videoMuted: true, userDisplayName: Plugin Test User, userEmail: [email protected], iosAppBarRGBAColor :#0080FF80, featureFlags: {FeatureFlagEnum.WELCOME_PAGE_ENABLED: false} }
===================================== Join meeting
listener Instance of 'JitsiMeetingListener'
webOptions {"roomName":"plugintestroom","width":"100%","height":"100%","enableWelcomePage":false,"chromeExtensionBanner":null,"userInfo":{"displayName":"Plugin Test User"}}
serverUrl meet.jit.si before calling jisi meet api
{"roomName":"plugintestroom","width":"100%","height":"100%","enableWelcomePage":false,"chromeExtensionBanner":null,"userInfo":{"displayName":"Plugin Test User"}}
TypeError: Cannot read property 'shadowRoot' of undefined
at new JitsiMeetAPI (:12:80)
at jitsi_meet_web.JitsiMeetPlugin..joinMeeting (http://localhost:63772/packages/jitsi_meet_web/jitsi_meet_web.dart.lib.js:133:20)
at joinMeeting.next ()
at runBody (http://localhost:63772/dart_sdk.js:39052:34)
at Object._async [as async] (http://localhost:63772/dart_sdk.js:39083:7)
at jitsi_meet_web.JitsiMeetPlugin..joinMeeting (http://localhost:63772/packages/jitsi_meet_web/jitsi_meet_web.dart.lib.js:125:20)
at joinMeeting (http://localhost:63772/packages/jitsi_meet/jitsi_meet.dart.lib.js:59:79)
at joinMeeting.next ()
at runBody (http://localhost:63772/dart_sdk.js:39052:34)
at Object._async [as async] (http://localhost:63772/dart_sdk.js:39083:7)
at Function.joinMeeting (http://localhost:63772/packages/jitsi_meet/jitsi_meet.dart.lib.js:49:20)
at main._MeetingState.new._joinMeeting (http://localhost:63772/packages/jitsi_meet_example/main.dart.lib.js:1503:36)
at _joinMeeting.next ()
at runBody (http://localhost:63772/dart_sdk.js:39052:34)
at Object._async [as async] (http://localhost:63772/dart_sdk.js:39083:7)
at main._MeetingState.new.[_joinMeeting] (http://localhost:63772/packages/jitsi_meet_example/main.dart.lib.js:1474:20)
at http://localhost:63772/packages/jitsi_meet_example/main.dart.lib.js:1455:37
at ink_well._InkResponseState.new.[_handleTap] (http://localhost:63772/packages/flutter/src/material/icon_button.dart.lib.js:50511:42)
at tap.TapGestureRecognizer.new.invokeCallback (http://localhost:63772/packages/flutter/src/gestures/recognizer.dart.lib.js:203:18)
at tap.TapGestureRecognizer.new.handleTapUp (http://localhost:63772/packages/flutter/src/gestures/tap.dart.lib.js:417:40)
at tap.TapGestureRecognizer.new.[_checkUp] (http://localhost:63772/packages/flutter/src/gestures/tap.dart.lib.js:223:12)
at tap.TapGestureRecognizer.new.acceptGesture (http://localhost:63772/packages/flutter/src/gestures/tap.dart.lib.js:199:23)
at arena.GestureArenaManager.new.sweep (http://localhost:63772/packages/flutter/src/gestures/arena.dart.lib.js:222:31)
at binding$5.WidgetsFlutterBinding.new.handleEvent (http://localhost:63772/packages/flutter/src/gestures/binding.dart.lib.js:335:27)
at binding$5.WidgetsFlutterBinding.new.dispatchEvent (http://localhost:63772/packages/flutter/src/gestures/binding.dart.lib.js:314:24)
at binding$5.WidgetsFlutterBinding.new.dispatchEvent (http://localhost:63772/packages/flutter/src/rendering/layer.dart.lib.js:6087:13)
at binding$5.WidgetsFlutterBinding.new.[_handlePointerEventImmediately] (http://localhost:63772/packages/flutter/src/gestures/binding.dart.lib.js:285:14)
at binding$5.WidgetsFlutterBinding.new.handlePointerEvent (http://localhost:63772/packages/flutter/src/gestures/binding.dart.lib.js:258:43)
at binding$5.WidgetsFlutterBinding.new.[_flushPointerEventQueue] (http://localhost:63772/packages/flutter/src/gestures/binding.dart.lib.js:247:14)
at binding$5.WidgetsFlutterBinding.new.[_handlePointerDataPacket] (http://localhost:63772/packages/flutter/src/gestures/binding.dart.lib.js:237:65)
at Object.invoke1 (http://localhost:63772/dart_sdk.js:183773:7)
at _engine.EnginePlatformDispatcher..invokeOnPointerDataPacket (http://localhost:63772/dart_sdk.js:164269:15)
at _engine.PointerBinding..[_onPointerData] (http://localhost:63772/dart_sdk.js:164903:49)
at http://localhost:63772/dart_sdk.js:165355:26
at http://localhost:63772/dart_sdk.js:165308:16
at http://localhost:63772/dart_sdk.js:165007:11
Hello,
thank you for putting effort in making this plugin available also for web. I think this would be a huge win.
I am new to flutter so its hard for me to include this plugin from source and figuring out how to use it. So far, I cloned the repo and referenced it in the pubspec.yaml
jitsi_meet:
path: ../jitsi_meet_plugin/jitsi_meet
jitsi_meet_web:
path: ../jitsi_meet_plugin/jitsi_meet_web
In my dart file i am trying to use the following code:
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:jitsi_meet/jitsi_meet.dart';
import 'package:jitsi_meet/room_name_constraint.dart';
import 'package:jitsi_meet/room_name_constraint_type.dart';
import 'package:jitsi_meet_web/jitsi_meet_web.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final serverText = TextEditingController();
final roomText = TextEditingController(text: "plugintestroom");
final subjectText = TextEditingController(text: "My Plugin Test Meeting");
final nameText = TextEditingController(text: "Plugin Test User");
final emailText = TextEditingController(text: "[email protected]");
final iosAppBarRGBAColor =
TextEditingController(text: "#0080FF80"); //transparent blue
var isAudioOnly = true;
var isAudioMuted = true;
var isVideoMuted = true;
@override
void initState() {
super.initState();
JitsiMeet.addListener(JitsiMeetingListener(
onConferenceWillJoin: _onConferenceWillJoin,
onConferenceJoined: _onConferenceJoined,
onConferenceTerminated: _onConferenceTerminated,
onError: _onError));
}
@override
void dispose() {
super.dispose();
JitsiMeet.removeAllListeners();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Container(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
),
child: SingleChildScrollView(
child: Column(
children: <Widget>[
SizedBox(
height: 24.0,
),
TextField(
controller: serverText,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: "Server URL",
hintText: "Hint: Leave empty for meet.jitsi.si"),
),
SizedBox(
height: 16.0,
),
TextField(
controller: roomText,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: "Room",
),
),
SizedBox(
height: 16.0,
),
TextField(
controller: subjectText,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: "Subject",
),
),
SizedBox(
height: 16.0,
),
TextField(
controller: nameText,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: "Display Name",
),
),
SizedBox(
height: 16.0,
),
TextField(
controller: emailText,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: "Email",
),
),
SizedBox(
height: 16.0,
),
TextField(
controller: iosAppBarRGBAColor,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: "AppBar Color(IOS only)",
hintText: "Hint: This HAS to be in HEX RGBA format"),
),
SizedBox(
height: 16.0,
),
CheckboxListTile(
title: Text("Audio Only"),
value: isAudioOnly,
onChanged: _onAudioOnlyChanged,
),
SizedBox(
height: 16.0,
),
CheckboxListTile(
title: Text("Audio Muted"),
value: isAudioMuted,
onChanged: _onAudioMutedChanged,
),
SizedBox(
height: 16.0,
),
CheckboxListTile(
title: Text("Video Muted"),
value: isVideoMuted,
onChanged: _onVideoMutedChanged,
),
Divider(
height: 48.0,
thickness: 2.0,
),
SizedBox(
height: 64.0,
width: double.maxFinite,
child: RaisedButton(
onPressed: () {
_joinMeeting();
},
child: Text(
"Join Meeting",
style: TextStyle(color: Colors.white),
),
color: Colors.blue,
),
),
SizedBox(
height: 48.0,
),
],
),
),
),
),
);
}
_onAudioOnlyChanged(bool value) {
setState(() {
isAudioOnly = value;
});
}
_onAudioMutedChanged(bool value) {
setState(() {
isAudioMuted = value;
});
}
_onVideoMutedChanged(bool value) {
setState(() {
isVideoMuted = value;
});
}
_joinMeeting() async {
String serverUrl =
serverText.text?.trim()?.isEmpty ?? "" ? null : serverText.text;
try {
// Enable or disable any feature flag here
// If feature flag are not provided, default values will be used
// Full list of feature flags (and defaults) available in the README
Map<FeatureFlagEnum, bool> featureFlags = {
FeatureFlagEnum.WELCOME_PAGE_ENABLED: false,
};
// Here is an example, disabling features for each platform
if (Platform.isAndroid) {
// Disable ConnectionService usage on Android to avoid issues (see README)
featureFlags[FeatureFlagEnum.CALL_INTEGRATION_ENABLED] = false;
} else if (Platform.isIOS) {
// Disable PIP on iOS as it looks weird
featureFlags[FeatureFlagEnum.PIP_ENABLED] = false;
}
// Define meetings options here
var options = JitsiMeetingOptions()
..room = roomText.text
..serverURL = serverUrl
..subject = subjectText.text
..userDisplayName = nameText.text
..userEmail = emailText.text
..iosAppBarRGBAColor = iosAppBarRGBAColor.text
..audioOnly = isAudioOnly
..audioMuted = isAudioMuted
..videoMuted = isVideoMuted
..featureFlags.addAll(featureFlags);
debugPrint("JitsiMeetingOptions: $options");
await JitsiMeet.joinMeeting(
options,
listener: JitsiMeetingListener(onConferenceWillJoin: ({message}) {
debugPrint("${options.room} will join with message: $message");
}, onConferenceJoined: ({message}) {
debugPrint("${options.room} joined with message: $message");
}, onConferenceTerminated: ({message}) {
debugPrint("${options.room} terminated with message: $message");
}),
// by default, plugin default constraints are used
//roomNameConstraints: new Map(), // to disable all constraints
//roomNameConstraints: customContraints, // to use your own constraint(s)
);
} catch (error) {
debugPrint("error: $error");
}
}
static final Map<RoomNameConstraintType, RoomNameConstraint>
customContraints = {
RoomNameConstraintType.MAX_LENGTH: new RoomNameConstraint((value) {
return value.trim().length <= 50;
}, "Maximum room name length should be 30."),
RoomNameConstraintType.FORBIDDEN_CHARS: new RoomNameConstraint((value) {
return RegExp(r"[$€£]+", caseSensitive: false, multiLine: false)
.hasMatch(value) ==
false;
}, "Currencies characters aren't allowed in room names."),
};
void _onConferenceWillJoin({message}) {
debugPrint("_onConferenceWillJoin broadcasted with message: $message");
}
void _onConferenceJoined({message}) {
debugPrint("_onConferenceJoined broadcasted with message: $message");
}
void _onConferenceTerminated({message}) {
debugPrint("_onConferenceTerminated broadcasted with message: $message");
}
_onError(error) {
debugPrint("_onError broadcasted: $error");
}
}
When I try to run the application I get the following error:
ReferenceError: JitsiMeetExternalAPI is not defined
at <anonymous>:1:28
at HTMLHeadElement.[dartx.append] (http://localhost:43583/dart_sdk.js:64016:31)
at html$._ChildrenElementList._wrap.add (http://localhost:43583/dart_sdk.js:81297:32)
at jitsi_meet_web.JitsiMeetPlugin.__.[_setupScripts] (http://localhost:43583/packages/jitsi_meet_web/jitsi_meet_web.dart.lib.js:222:50)
I hope you can help me and thank you again for your effort.
Best,
wirthual
I tried to add the path meeting.vm.uni-freiburg.de in the GUI but it seems I was still connecting to meet.jit.si
I followed your instructions but when running my app in the browser and joining a meeting I get the following error: TypeError: document.getElementsByTagName(...)[0] is undefined in the file js_primitives.dart:30:4
Can you help?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.