|
@@ -33,7 +33,7 @@ dependencies {
|
33
|
33
|
}
|
34
|
34
|
```
|
35
|
35
|
|
36
|
|
-Also, enable 32bit mode for react-native, since react-native only supports 32bit apps. (If you have a 64bit device, it will not run unless this setting it set)
|
|
36
|
+Also, enable 32bit mode for react-native, since the react-native version we currently depend on only supports 32bit apps. (If you have a 64bit device, it will not run unless this setting it set).
|
37
|
37
|
|
38
|
38
|
```gradle
|
39
|
39
|
android {
|
|
@@ -167,14 +167,14 @@ View is strongly recommended.
|
167
|
167
|
package org.jitsi.example;
|
168
|
168
|
|
169
|
169
|
import android.os.Bundle;
|
170
|
|
-import android.support.v7.app.AppCompatActivity;
|
|
170
|
+import android.support.v4.app.FragmentActivity;
|
171
|
171
|
|
172
|
172
|
import org.jitsi.meet.sdk.JitsiMeetView;
|
173
|
173
|
import org.jitsi.meet.sdk.ReactActivityLifecycleCallbacks;
|
174
|
174
|
|
175
|
175
|
// Example
|
176
|
176
|
//
|
177
|
|
-public class MainActivity extends AppCompatActivity {
|
|
177
|
+public class MainActivity extends FragmentActivity implements JitsiMeetActivityInterface {
|
178
|
178
|
private JitsiMeetView view;
|
179
|
179
|
|
180
|
180
|
@Override
|
|
@@ -182,13 +182,13 @@ public class MainActivity extends AppCompatActivity {
|
182
|
182
|
int requestCode,
|
183
|
183
|
int resultCode,
|
184
|
184
|
Intent data) {
|
185
|
|
- ReactActivityLifecycleCallbacks.onActivityResult(
|
|
185
|
+ JitsiMeetActivityDelegate.onActivityResult(
|
186
|
186
|
this, requestCode, resultCode, data);
|
187
|
187
|
}
|
188
|
188
|
|
189
|
189
|
@Override
|
190
|
190
|
public void onBackPressed() {
|
191
|
|
- ReactActivityLifecycleCallbacks.onBackPressed();
|
|
191
|
+ JitsiMeetActivityDelegate.onBackPressed();
|
192
|
192
|
}
|
193
|
193
|
|
194
|
194
|
@Override
|
|
@@ -196,7 +196,10 @@ public class MainActivity extends AppCompatActivity {
|
196
|
196
|
super.onCreate(savedInstanceState);
|
197
|
197
|
|
198
|
198
|
view = new JitsiMeetView(this);
|
199
|
|
- view.loadURL(null);
|
|
199
|
+ JitsiMeetConferenceOptions options = new JitsiMeetConferenceOptions.Builder()
|
|
200
|
+ .setRoom("https://meet.jit.si/test123")
|
|
201
|
+ .build();
|
|
202
|
+ view.join(options);
|
200
|
203
|
|
201
|
204
|
setContentView(view);
|
202
|
205
|
}
|
|
@@ -208,12 +211,12 @@ public class MainActivity extends AppCompatActivity {
|
208
|
211
|
view.dispose();
|
209
|
212
|
view = null;
|
210
|
213
|
|
211
|
|
- ReactActivityLifecycleCallbacks.onHostDestroy(this);
|
|
214
|
+ JitsiMeetActivityDelegate.onHostDestroy(this);
|
212
|
215
|
}
|
213
|
216
|
|
214
|
217
|
@Override
|
215
|
218
|
public void onNewIntent(Intent intent) {
|
216
|
|
- ReactActivityLifecycleCallbacks.onNewIntent(intent);
|
|
219
|
+ JitsiMeetActivityDelegate.onNewIntent(intent);
|
217
|
220
|
}
|
218
|
221
|
|
219
|
222
|
@Override
|
|
@@ -221,21 +224,21 @@ public class MainActivity extends AppCompatActivity {
|
221
|
224
|
final int requestCode,
|
222
|
225
|
final String[] permissions,
|
223
|
226
|
final int[] grantResults) {
|
224
|
|
- ReactActivityLifecycleCallbacks.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
|
227
|
+ JitsiMeetActivityDelegate.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
225
|
228
|
}
|
226
|
229
|
|
227
|
230
|
@Override
|
228
|
231
|
protected void onResume() {
|
229
|
232
|
super.onResume();
|
230
|
233
|
|
231
|
|
- ReactActivityLifecycleCallbacks.onHostResume(this);
|
|
234
|
+ JitsiMeetActivityDelegate.onHostResume(this);
|
232
|
235
|
}
|
233
|
236
|
|
234
|
237
|
@Override
|
235
|
238
|
protected void onStop() {
|
236
|
239
|
super.onStop();
|
237
|
240
|
|
238
|
|
- ReactActivityLifecycleCallbacks.onHostPause(this);
|
|
241
|
+ JitsiMeetActivityDelegate.onHostPause(this);
|
239
|
242
|
}
|
240
|
243
|
}
|
241
|
244
|
```
|
|
@@ -262,103 +265,62 @@ implementation("com.github.bumptech.glide:annotations:${glideVersion}") {
|
262
|
265
|
|
263
|
266
|
### JitsiMeetActivity
|
264
|
267
|
|
265
|
|
-This class encapsulates a high level API in the form of an Android `Activity`
|
266
|
|
-which displays a single `JitsiMeetView`.
|
|
268
|
+This class encapsulates a high level API in the form of an Android `FragmentActivity`
|
|
269
|
+which displays a single `JitsiMeetView`. You can pass a URL as a `ACTION_VIEW`
|
|
270
|
+on the Intent when starting it and it will join the conference, and will be
|
|
271
|
+automatically terminated (finish() will be called on the activity) when the
|
|
272
|
+conference ends or fails.
|
267
|
273
|
|
268
|
274
|
### JitsiMeetView
|
269
|
275
|
|
270
|
276
|
The `JitsiMeetView` class is the core of Jitsi Meet SDK. It's designed to
|
271
|
277
|
display a Jitsi Meet conference (or a welcome page).
|
272
|
278
|
|
|
279
|
+#### join(options)
|
|
280
|
+
|
|
281
|
+Joins the conference specified by the given `JitsiMeetConferenceOptions`.
|
|
282
|
+
|
|
283
|
+#### leave()
|
|
284
|
+
|
|
285
|
+Leaves the currently active conference. If the welcome page is enabled it will
|
|
286
|
+go back to it, otherwise a black window will be shown.
|
|
287
|
+
|
273
|
288
|
#### dispose()
|
274
|
289
|
|
275
|
290
|
Releases all resources associated with this view. This method MUST be called
|
276
|
291
|
when the Activity holding this view is going to be destroyed, usually in the
|
277
|
292
|
`onDestroy()` method.
|
278
|
293
|
|
279
|
|
-#### getDefaultURL()
|
280
|
|
-
|
281
|
|
-Returns the default base URL used to join a conference when a partial URL (e.g.
|
282
|
|
-a room name only) is specified to `loadURLString`/`loadURLObject`. If not set or
|
283
|
|
-if set to `null`, the default built in JavaScript is used: https://meet.jit.si.
|
284
|
|
-
|
285
|
294
|
#### getListener()
|
286
|
295
|
|
287
|
296
|
Returns the `JitsiMeetViewListener` instance attached to the view.
|
288
|
297
|
|
289
|
|
-#### isPictureInPictureEnabled()
|
290
|
|
-
|
291
|
|
-Returns `true` if Picture-in-Picture is enabled; `false`, otherwise. If not
|
292
|
|
-explicitly set (by a preceding `setPictureInPictureEnabled` call), defaults to
|
293
|
|
-`true` if the platform supports Picture-in-Picture natively; `false`, otherwise.
|
294
|
|
-
|
295
|
|
-#### isWelcomePageEnabled()
|
296
|
|
-
|
297
|
|
-Returns true if the Welcome page is enabled; otherwise, false. If false, a black
|
298
|
|
-empty view will be rendered when not in a conference. Defaults to false.
|
299
|
|
-
|
300
|
|
-#### loadURL(URL)
|
301
|
|
-
|
302
|
|
-Loads a specific URL which may identify a conference to join. If the specified
|
303
|
|
-URL is null and the Welcome page is enabled, the Welcome page is displayed
|
304
|
|
-instead.
|
305
|
|
-
|
306
|
|
-#### loadURLString(String)
|
307
|
|
-
|
308
|
|
-Loads a specific URL which may identify a conference to join. If the specified
|
309
|
|
-URL is null and the Welcome page is enabled, the Welcome page is displayed
|
310
|
|
-instead.
|
311
|
|
-
|
312
|
|
-#### loadURLObject(Bundle)
|
313
|
|
-
|
314
|
|
-Loads a specific URL which may identify a conference to join. The URL is
|
315
|
|
-specified in the form of a Bundle of properties which (1) internally are
|
316
|
|
-sufficient to construct a URL (string) while (2) abstracting the specifics of
|
317
|
|
-constructing the URL away from API clients/consumers. If the specified URL is
|
318
|
|
-null and the Welcome page is enabled, the Welcome page is displayed instead.
|
319
|
|
-
|
320
|
|
-Example:
|
321
|
|
-
|
322
|
|
-```java
|
323
|
|
-Bundle config = new Bundle();
|
324
|
|
-config.putBoolean("startWithAudioMuted", true);
|
325
|
|
-config.putBoolean("startWithVideoMuted", false);
|
326
|
|
-Bundle urlObject = new Bundle();
|
327
|
|
-urlObject.putBundle("config", config);
|
328
|
|
-urlObject.putString("url", "https://meet.jit.si/Test123");
|
329
|
|
-view.loadURLObject(urlObject);
|
330
|
|
-```
|
331
|
|
-
|
332
|
|
-#### setDefaultURL(URL)
|
333
|
|
-
|
334
|
|
-Sets the default URL. See `getDefaultURL` for more information.
|
335
|
|
-
|
336
|
|
-NOTE: Must be called before (if at all) `loadURL`/`loadURLString` for it to take
|
337
|
|
-effect.
|
338
|
|
-
|
339
|
298
|
#### setListener(listener)
|
340
|
299
|
|
341
|
300
|
Sets the given listener (class implementing the `JitsiMeetViewListener`
|
342
|
301
|
interface) on the view.
|
343
|
302
|
|
344
|
|
-#### setPictureInPictureEnabled(boolean)
|
|
303
|
+### JitsiMeetConferenceOptions
|
345
|
304
|
|
346
|
|
-Sets whether Picture-in-Picture is enabled. If not set, Jitsi Meet SDK
|
347
|
|
-automatically enables/disables Picture-in-Picture based on native platform
|
348
|
|
-support.
|
|
305
|
+This object encapsulates all the options that can be tweaked when joining
|
|
306
|
+a conference.
|
349
|
307
|
|
350
|
|
-NOTE: Must be called (if at all) before `loadURL`/`loadURLString` for it to take
|
351
|
|
-effect.
|
352
|
|
-
|
353
|
|
-#### setWelcomePageEnabled(boolean)
|
|
308
|
+Example:
|
354
|
309
|
|
355
|
|
-Sets whether the Welcome page is enabled. See `isWelcomePageEnabled` for more
|
356
|
|
-information.
|
|
310
|
+```java
|
|
311
|
+JitsiMeetConferenceOptions options = new JitsiMeetConferenceOptions.Builder()
|
|
312
|
+ .setServerURL(new URL("https://meet.jit.si"))
|
|
313
|
+ .setRoom("test123")
|
|
314
|
+ .setAudioMuted(false)
|
|
315
|
+ .setVideoMuted(false)
|
|
316
|
+ .setAudioOnly(false)
|
|
317
|
+ .setWelcomePageEnabled(false)
|
|
318
|
+ .build();
|
|
319
|
+```
|
357
|
320
|
|
358
|
|
-NOTE: Must be called (if at all) before `loadURL`/`loadURLString` for it to take
|
359
|
|
-effect.
|
|
321
|
+See the `JitsiMeetConferenceOptions` implementation for all available options.
|
360
|
322
|
|
361
|
|
-### ReactActivityLifecycleCallbacks
|
|
323
|
+### JitsiMeetActivityDelegate
|
362
|
324
|
|
363
|
325
|
This class handles the interaction between `JitsiMeetView` and its enclosing
|
364
|
326
|
`Activity`. Generally this shouldn't be consumed by users, because they'd be
|
|
@@ -470,10 +432,6 @@ rules file: https://github.com/jitsi/jitsi-meet/blob/master/android/app/proguard
|
470
|
432
|
Picture-in-Picture style scenario, in a rectangle too small to accommodate its
|
471
|
433
|
"full" UI.
|
472
|
434
|
|
473
|
|
-Jitsi Meet SDK automatically enables (unless explicitly disabled by a
|
474
|
|
-`setPictureInPictureEnabled(false)` call) Android's native Picture-in-Picture
|
475
|
|
-mode iff the platform is supported i.e. Android >= Oreo.
|
476
|
|
-
|
477
|
435
|
## Dropbox integration
|
478
|
436
|
|
479
|
437
|
To setup the Dropbox integration, follow these steps:
|