|
@@ -29,7 +29,8 @@ import java.lang.reflect.Method;
|
29
|
29
|
import java.util.Map;
|
30
|
30
|
|
31
|
31
|
|
32
|
|
-public class JitsiMeetView extends BaseReactView<JitsiMeetViewListener> {
|
|
32
|
+public class JitsiMeetView extends BaseReactView<JitsiMeetViewListener>
|
|
33
|
+ implements OngoingConferenceTracker.OngoingConferenceListener {
|
33
|
34
|
|
34
|
35
|
/**
|
35
|
36
|
* The {@code Method}s of {@code JitsiMeetViewListener} by event name i.e.
|
|
@@ -106,6 +107,14 @@ public class JitsiMeetView extends BaseReactView<JitsiMeetViewListener> {
|
106
|
107
|
if (!(context instanceof JitsiMeetActivityInterface)) {
|
107
|
108
|
throw new RuntimeException("Enclosing Activity must implement JitsiMeetActivityInterface");
|
108
|
109
|
}
|
|
110
|
+
|
|
111
|
+ OngoingConferenceTracker.addListener(this);
|
|
112
|
+ }
|
|
113
|
+
|
|
114
|
+ @Override
|
|
115
|
+ public void dispose() {
|
|
116
|
+ OngoingConferenceTracker.removeListener(this);
|
|
117
|
+ super.dispose();
|
109
|
118
|
}
|
110
|
119
|
|
111
|
120
|
/**
|
|
@@ -173,27 +182,17 @@ public class JitsiMeetView extends BaseReactView<JitsiMeetViewListener> {
|
173
|
182
|
}
|
174
|
183
|
|
175
|
184
|
/**
|
176
|
|
- * The internal processing for the URL of the current conference set on the
|
177
|
|
- * associated {@link JitsiMeetView}.
|
178
|
|
- *
|
179
|
|
- * @param eventName the name of the external API event to be processed
|
180
|
|
- * @param eventData the details/specifics of the event to process determined
|
181
|
|
- * by/associated with the specified {@code eventName}.
|
|
185
|
+ * Handler for {@link OngoingConferenceTracker} events.
|
|
186
|
+ * @param conferenceUrl
|
182
|
187
|
*/
|
183
|
|
- private void maybeSetViewURL(String eventName, ReadableMap eventData) {
|
184
|
|
- String url = eventData.hasKey("url") ? eventData.getString("url") : null;
|
185
|
|
-
|
186
|
|
- switch(eventName) {
|
187
|
|
- case "CONFERENCE_WILL_JOIN":
|
188
|
|
- this.url = url;
|
189
|
|
- break;
|
190
|
|
-
|
191
|
|
- case "CONFERENCE_TERMINATED":
|
192
|
|
- if (url != null && url.equals(this.url)) {
|
193
|
|
- this.url = null;
|
194
|
|
- }
|
195
|
|
- break;
|
196
|
|
- }
|
|
188
|
+ @Override
|
|
189
|
+ public void onCurrentConferenceChanged(String conferenceUrl) {
|
|
190
|
+ // This property was introduced in order to address
|
|
191
|
+ // an exception in the Picture-in-Picture functionality which arose
|
|
192
|
+ // because of delays related to bridging between JavaScript and Java. To
|
|
193
|
+ // reduce these delays do not wait for the call to be transferred to the
|
|
194
|
+ // UI thread.
|
|
195
|
+ this.url = conferenceUrl;
|
197
|
196
|
}
|
198
|
197
|
|
199
|
198
|
/**
|
|
@@ -205,13 +204,6 @@ public class JitsiMeetView extends BaseReactView<JitsiMeetViewListener> {
|
205
|
204
|
*/
|
206
|
205
|
@Override
|
207
|
206
|
protected void onExternalAPIEvent(String name, ReadableMap data) {
|
208
|
|
- // XXX The JitsiMeetView property URL was introduced in order to address
|
209
|
|
- // an exception in the Picture-in-Picture functionality which arose
|
210
|
|
- // because of delays related to bridging between JavaScript and Java. To
|
211
|
|
- // reduce these delays do not wait for the call to be transferred to the
|
212
|
|
- // UI thread.
|
213
|
|
- maybeSetViewURL(name, data);
|
214
|
|
-
|
215
|
207
|
onExternalAPIEvent(LISTENER_METHODS, name, data);
|
216
|
208
|
}
|
217
|
209
|
}
|