capacitor-jitsi-meet 2.2.0 → 2.2.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -1
- package/README.md +3 -0
- package/android/src/main/java/com/capacitor/jitsi/plugin/JitsiActivity.java +40 -4
- package/dist/esm/definitions.d.ts +4 -19
- package/dist/esm/web.d.ts +4 -19
- package/dist/esm/web.js.map +1 -1
- package/ios/Plugin/Plugin/JitsiMeetViewController.swift +7 -0
- package/ios/Plugin/Plugin/Plugin.swift +12 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,12 @@ Each version of the capacitor plugin uses a specific Jitsi SDK version. In iOS d
|
|
|
4
4
|
|
|
5
5
|
See Jitsi-meet SDK [changelog](https://github.com/jitsi/jitsi-meet-release-notes/blob/master/CHANGELOG-MOBILE-SDKS.md)
|
|
6
6
|
|
|
7
|
-
# 2.2.
|
|
7
|
+
# 2.2.1 (2022-03-11)
|
|
8
|
+
|
|
9
|
+
- bug fix: onConferenceJoined and onConferenceLeft not firing
|
|
10
|
+
- bug fix: iOS leaveConference() not working
|
|
11
|
+
|
|
12
|
+
2.2.0 (2022-03-04)
|
|
8
13
|
|
|
9
14
|
## Breaking Changes
|
|
10
15
|
|
package/README.md
CHANGED
|
@@ -108,6 +108,7 @@ const result = await Jitsi.joinConference({
|
|
|
108
108
|
recordingEnabled: false, // (experimental) enable recording feature
|
|
109
109
|
screenSharingEnabled: false, // (experimental) enable screen sharing feature
|
|
110
110
|
});
|
|
111
|
+
console.log(result) // { success: true }
|
|
111
112
|
|
|
112
113
|
window.addEventListener('onConferenceJoined', () => {
|
|
113
114
|
// do things here
|
|
@@ -116,6 +117,8 @@ window.addEventListener('onConferenceLeft', () => {
|
|
|
116
117
|
// do things here
|
|
117
118
|
});
|
|
118
119
|
|
|
120
|
+
const result = await Jitsi.leaveConference()
|
|
121
|
+
console.log(result) // { success: true }
|
|
119
122
|
```
|
|
120
123
|
|
|
121
124
|
3. Build the project
|
|
@@ -5,10 +5,9 @@ import android.content.BroadcastReceiver;
|
|
|
5
5
|
import android.content.Context;
|
|
6
6
|
import android.content.Intent;
|
|
7
7
|
import android.content.IntentFilter;
|
|
8
|
-
import android.
|
|
9
|
-
import android.os.Bundle;
|
|
8
|
+
import android.net.Uri;
|
|
10
9
|
|
|
11
|
-
import androidx.annotation.
|
|
10
|
+
import androidx.annotation.Nullable;
|
|
12
11
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
|
13
12
|
import timber.log.Timber;
|
|
14
13
|
|
|
@@ -20,8 +19,20 @@ public class JitsiActivity extends JitsiMeetActivity {
|
|
|
20
19
|
private BroadcastReceiver broadcastReceiver;
|
|
21
20
|
private static final String TAG = "CapacitorJitsiMeet";
|
|
22
21
|
private static final String ACTION_JITSI_MEET_CONFERENCE = "org.jitsi.meet.CONFERENCE";
|
|
22
|
+
private static final String JITSI_MEET_CONFERENCE_OPTIONS = "JitsiMeetConferenceOptions";
|
|
23
23
|
private static JitsiMeetConferenceOptions session_options;
|
|
24
24
|
|
|
25
|
+
@Override
|
|
26
|
+
protected void initialize() {
|
|
27
|
+
broadcastReceiver = new BroadcastReceiver() {
|
|
28
|
+
@Override
|
|
29
|
+
public void onReceive(Context context, Intent intent) {
|
|
30
|
+
onBroadcastReceived(intent);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
registerForBroadcastMessages();
|
|
34
|
+
join(getConferenceOptions(getIntent()));
|
|
35
|
+
}
|
|
25
36
|
// this overrides the launch class and runs the extended JitsiActivity class instead
|
|
26
37
|
public static void launch(Context context, JitsiMeetConferenceOptions options) {
|
|
27
38
|
session_options = options;
|
|
@@ -34,11 +45,20 @@ public class JitsiActivity extends JitsiMeetActivity {
|
|
|
34
45
|
context.startActivity(intent);
|
|
35
46
|
}
|
|
36
47
|
|
|
48
|
+
private void registerForBroadcastMessages() {
|
|
49
|
+
IntentFilter intentFilter = new IntentFilter();
|
|
50
|
+
|
|
51
|
+
for (BroadcastEvent.Type type : BroadcastEvent.Type.values()) {
|
|
52
|
+
intentFilter.addAction(type.getAction());
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
LocalBroadcastManager.getInstance(this).registerReceiver(broadcastReceiver, intentFilter);
|
|
56
|
+
}
|
|
57
|
+
|
|
37
58
|
private void onBroadcastReceived(Intent intent) {
|
|
38
59
|
JitsiMeetView view = getJitsiView();
|
|
39
60
|
if (intent != null) {
|
|
40
61
|
BroadcastEvent event = new BroadcastEvent(intent);
|
|
41
|
-
|
|
42
62
|
switch (event.getType()) {
|
|
43
63
|
case CONFERENCE_JOINED:
|
|
44
64
|
on("onConferenceJoined");
|
|
@@ -90,5 +110,21 @@ public class JitsiActivity extends JitsiMeetActivity {
|
|
|
90
110
|
Timber.tag(TAG).d("Is in picture-in-picture mode: " + isInPictureInPictureMode);
|
|
91
111
|
}
|
|
92
112
|
|
|
113
|
+
private @Nullable
|
|
114
|
+
JitsiMeetConferenceOptions getConferenceOptions(Intent intent) {
|
|
115
|
+
String action = intent.getAction();
|
|
116
|
+
|
|
117
|
+
if (Intent.ACTION_VIEW.equals(action)) {
|
|
118
|
+
Uri uri = intent.getData();
|
|
119
|
+
if (uri != null) {
|
|
120
|
+
return new JitsiMeetConferenceOptions.Builder().setRoom(uri.toString()).build();
|
|
121
|
+
}
|
|
122
|
+
} else if (ACTION_JITSI_MEET_CONFERENCE.equals(action)) {
|
|
123
|
+
return intent.getParcelableExtra(JITSI_MEET_CONFERENCE_OPTIONS);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
|
|
93
129
|
private static final String ADD_PEOPLE_CONTROLLER_QUERY = null;
|
|
94
130
|
}
|
|
@@ -19,24 +19,9 @@ export interface JitsiPlugin {
|
|
|
19
19
|
featureFlags?: any;
|
|
20
20
|
configOverrides?: any;
|
|
21
21
|
}): Promise<{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
displayName?: string;
|
|
27
|
-
subject?: string;
|
|
28
|
-
email?: string;
|
|
29
|
-
avatarURL?: string;
|
|
30
|
-
startWithAudioMuted?: boolean;
|
|
31
|
-
startWithVideoMuted?: boolean;
|
|
32
|
-
chatEnabled?: boolean;
|
|
33
|
-
inviteEnabled?: boolean;
|
|
34
|
-
callIntegrationEnabled?: boolean;
|
|
35
|
-
recordingEnabled?: boolean;
|
|
36
|
-
liveStreamingEnabled?: boolean;
|
|
37
|
-
screenSharingEnabled?: boolean;
|
|
38
|
-
featureFlags?: any;
|
|
39
|
-
configOverrides?: any;
|
|
22
|
+
success?: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
leaveConference(options?: {}): Promise<{
|
|
25
|
+
success?: boolean;
|
|
40
26
|
}>;
|
|
41
|
-
leaveConference(options: {}): Promise<{}>;
|
|
42
27
|
}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -21,26 +21,11 @@ export declare class JitsiWeb extends WebPlugin implements JitsiPlugin {
|
|
|
21
21
|
featureFlags?: any;
|
|
22
22
|
configOverrides?: any;
|
|
23
23
|
}): Promise<{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
displayName?: string;
|
|
29
|
-
subject?: string;
|
|
30
|
-
email?: string;
|
|
31
|
-
avatarURL?: string;
|
|
32
|
-
startWithAudioMuted?: boolean;
|
|
33
|
-
startWithVideoMuted?: boolean;
|
|
34
|
-
chatEnabled?: boolean;
|
|
35
|
-
inviteEnabled?: boolean;
|
|
36
|
-
callIntegrationEnabled?: boolean;
|
|
37
|
-
recordingEnabled?: boolean;
|
|
38
|
-
liveStreamingEnabled?: boolean;
|
|
39
|
-
screenSharingEnabled?: boolean;
|
|
40
|
-
featureFlags?: any;
|
|
41
|
-
configOverrides?: any;
|
|
24
|
+
success?: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
leaveConference(options?: {}): Promise<{
|
|
27
|
+
success?: boolean;
|
|
42
28
|
}>;
|
|
43
|
-
leaveConference(options: {}): Promise<{}>;
|
|
44
29
|
}
|
|
45
30
|
declare const Jitsi: JitsiWeb;
|
|
46
31
|
export { Jitsi };
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,MAAM,OAAO,QAAS,SAAQ,SAAS;IAErC,aAAa;IACL,cAAc,CAAC,OAmBtB;;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,MAAM,OAAO,QAAS,SAAQ,SAAS;IAErC,aAAa;IACL,cAAc,CAAC,OAmBtB;;YAGG,MAAM,IAAI,CAAC,WAAW,CAAC,kGAAkG,CAAC,CAAC;QAC/H,CAAC;KAAA;IAAA,CAAC;IACA,aAAa;IACT,eAAe,CAAC,OAAY;;YAC9B,MAAM,IAAI,CAAC,WAAW,CAAC,kGAAkG,CAAC,CAAC;QAC/H,CAAC;KAAA;IAAA,CAAC;CACH;AAED,MAAM,KAAK,GAAG,IAAI,QAAQ,EAAE,CAAC;AAE7B,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -63,6 +63,13 @@ public class JitsiMeetViewController: UIViewController, UIGestureRecognizerDeleg
|
|
|
63
63
|
jitsiMeetView?.removeFromSuperview()
|
|
64
64
|
jitsiMeetView = nil
|
|
65
65
|
}
|
|
66
|
+
|
|
67
|
+
public func leave() {
|
|
68
|
+
print("[Jitsi Plugin Native iOS]: JitsiMeetViewController::leave");
|
|
69
|
+
let jitsiMeetView = JitsiMeetView()
|
|
70
|
+
self.jitsiMeetView = jitsiMeetView
|
|
71
|
+
jitsiMeetView.hangUp()
|
|
72
|
+
}
|
|
66
73
|
}
|
|
67
74
|
|
|
68
75
|
protocol JitsiMeetViewControllerDelegate: AnyObject {
|
|
@@ -108,17 +108,26 @@ public class Jitsi: CAPPlugin {
|
|
|
108
108
|
self.jitsiMeetViewController?.delegate = self;
|
|
109
109
|
|
|
110
110
|
DispatchQueue.main.async {
|
|
111
|
-
self.bridge?.viewController?.present(self.jitsiMeetViewController!, animated: true, completion:
|
|
111
|
+
self.bridge?.viewController?.present(self.jitsiMeetViewController!, animated: true, completion: { call.resolve(["success": true ]) });
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@objc func leaveConference(_ call: CAPPluginCall) {
|
|
116
|
+
DispatchQueue.main.async {
|
|
117
|
+
self.jitsiMeetViewController?.leave();
|
|
118
|
+
call.resolve([
|
|
119
|
+
"success": true
|
|
120
|
+
])
|
|
112
121
|
}
|
|
113
122
|
}
|
|
114
123
|
}
|
|
115
124
|
|
|
116
125
|
extension Jitsi: JitsiMeetViewControllerDelegate {
|
|
117
126
|
@objc func onConferenceJoined() {
|
|
118
|
-
self.bridge?.
|
|
127
|
+
self.bridge?.triggerJSEvent(eventName: "onConferenceJoined", target: "window");
|
|
119
128
|
}
|
|
120
129
|
|
|
121
130
|
@objc func onConferenceLeft() {
|
|
122
|
-
self.bridge?.
|
|
131
|
+
self.bridge?.triggerJSEvent(eventName: "onConferenceLeft", target: "window");
|
|
123
132
|
}
|
|
124
133
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "capacitor-jitsi-meet",
|
|
3
|
-
"version": "2.2.0",
|
|
3
|
+
"version": "2.2.1-beta.0",
|
|
4
4
|
"description": "This Ionic Capacitor plugin is created to make video calls through the free, open-sourced Jitsi video platform (https://meet.jit.si) on iOS and Android.",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|