Commit Graph

102 Commits

Author SHA1 Message Date
Saúl Ibarra Corretgé dc246960df feat(App): refactor App and split it into BaseApp and App
BaseApp does all the heavy-lifting related to creating the redux store,
navigation, and so on.

App currently handles URL props and actually triggering navigation based on
them.
2018-07-12 11:28:19 -05:00
Saúl Ibarra Corretgé 47aa14e9f6 [iOS] Fix syncing muted state with CallKit
Fix the "mute ping pong" for once and for all. This patch takes a new approach
to the problem: it keeps track of the user generated CallKit transaction ations
and avoids calling the delegate method in those cases.

This results in a much cleaner and easier to understand handling of the flow: if
the delegate method is called it means the user tapped on the mute button. When
we sync the muted state in JS with CallKit the delegate method won't be called
at all, thus avoiding the ping-pong altogether.

In addition, make sure all CallKit methods run in the UI thread. CallKit will
call our delegate methods in the UI thread too, thsu there is no need to
synchronize access to the listener / pending action sets.
2018-06-22 11:25:09 +02:00
Saúl Ibarra Corretgé ec8ad6190d [iOS] Only update the matching local track data in CallKit 2018-06-22 11:25:09 +02:00
Saúl Ibarra Corretgé 42b85f73bd [iOS] Fix checking if a track is local in ithe CallKit middleware
Not all TRACK_ actions include the `local` attribute, so use the underlying
`jitsiTrack` to check it.
2018-06-22 11:25:09 +02:00
Saúl Ibarra Corretgé 146ffb0918
Merge pull request #3153 from jitsi/connection_corner_cases
Connection corner cases
2018-06-20 16:53:48 +02:00
paweldomas b2f76f3ed6 ref(mobile/external-api): skip event if conference exists
The change to mobile/external-api is required to not emit
CONFERENCE_FAILED for CONNECTION_FAILED if the conference has been
started, because base/conference state will still hold conference
instances which are to be ended by other means and result in the
appropriate event (which will adjust the base/conference state).
2018-06-20 15:52:46 +02:00
Saúl Ibarra Corretgé 7fa941cb8c [iOS] Fix setting call type in CallKit
Your truly introduced this regression in
8c7a3f16b1, alas.

The audio only mode is used to set the CallKit call type. This affects the
behavior on the recent calls entries (calls are marked either as audio or video
calls).

Sync both at the start and for transitions. The previous code was working by
chance (in a way): when the CallKit UI is presented the local video is muted,
which triggers a SET_VIDEO_MUTED action, at which point the audio-only mode was
checked for. Now we are more explicit and act on SET_AUDIO_MUTED.
2018-06-20 08:42:30 -05:00
Saúl Ibarra Corretgé 8c7a3f16b1 [iOS] Refactor muted state handling in CallKit
Rely solely on actual track state, rather than the desired state, (what
base/media represents).
2018-06-19 15:53:43 +02:00
Saúl Ibarra Corretgé 84c1c3dfd3 [iOS] Fix starting a call muted when permission was not granted
Read the muted state from the track itself instead of from base/media. This
avoid expressing the incorrect desire when the call starts muted because
permission was never granted.
2018-06-19 15:53:43 +02:00
Saúl Ibarra Corretgé 28861c0054 [iOS] Fix incorrect call to setAudioMuted in CallKit
Audio muting does not have an authority.
2018-06-18 15:45:37 -05:00
Lyubo Marinov a82ed4653e [RN] Allow to override callHandle for CallKit (coding style) 2018-06-08 15:18:11 -05:00
Daniel Ornelas 81be082fe7 [RN] Allow to override callHandle for CallKit 2018-06-08 15:18:11 -05:00
Guus der Kinderen ccf0c8a363 fix(i18n) Accessiblity labels translations (#3071)
* fix(toolbar): accessibilityLabel should be translatable.

This commit adds a helper property to get the accessibilityLabel of an item,
providing a translation if one is available. This mimics the behavior of
label and tooltip.

* fix(toolbar) 'hangup' button accessibilityLabel i18n

* fix(toolbar) 'mute' button accessibilityLabel i18n

* fix(toolbar) 'videomute' button accessibilityLabel i18n

* fix(toolbar) 'moreActions' button accessibilityLabel i18n

* fix(toolbar) 'shareRoom' button accessibilityLabel i18n

* fix(toolbar) 'audioRoute' button accessibilityLabel i18n

* fix(toolbar) 'toggleCamera' button accessibilityLabel i18n

* fix(toolbar) 'audioOnly' button accessibilityLabel i18n

* fix(toolbar) 'roomLock' button accessibilityLabel i18n

* fix(toolbar) 'pip' button accessibilityLabel i18n

* fix(toolbar) 'invite' button accessibilityLabel i18n

* fix(toolbar) 'raiseHand' button accessibilityLabel i18n

* fix(toolbar) 'chat' button accessibilityLabel i18n

* fix(toolbar) 'shareYourScreen' button accessibilityLabel i18n

* fix(toolbar) 'fullScreen' button accessibilityLabel i18n

* fix(toolbar) 'sharedvideo' button accessibilityLabel i18n

* fix(toolbar) 'document' button accessibilityLabel i18n

* fix(toolbar) 'speakerStats' button accessibilityLabel i18n

* fix(toolbar) 'feedback' button accessibilityLabel i18n

* fix(toolbar) 'shortcuts' button accessibilityLabel i18n

* fix(toolbar) 'recording' button accessibilityLabel i18n

* fix(toolbar) 'settings' button accessibilityLabel i18n

* fix(welcomepage) accessibilityLabels i18n

* fix(toolbar) 'info' button accessibilityLabel i18n

* fix(i18n): Add translation to various aria-label property values.

* fix(i18n): Differentiate between overflow menu and button.
2018-06-07 13:32:18 -07:00
paweldomas 701552ec8f ref(mobile/wake-lock): convert middleware to a state listener
If CONFERENCE_LEFT would arrive with a delay while we're in
another conference already, then the wake lock could end up in
an incorrect state.
2018-05-30 16:29:27 +02:00
paweldomas d26d1ff925 ref(mobile/proximity): convert middleware to a state listener 2018-05-30 16:29:27 +02:00
paweldomas bcb955ea72 ref(full-screen/middleware): use StateListenerRegistry
Use state listener to simplify the logic and not care about the actions
since the fullscreen flag is calculated from the current conference
state.
2018-05-30 16:29:27 +02:00
paweldomas dbd1091364 ref: use getCurrentConference
Try to use the getCurrentConference function wherever the indention is
to check for the current conference.
2018-05-30 16:29:27 +02:00
paweldomas 7186a9c79c fix(base/participants): ensure default local id outside of conference
Makes sure that whenever a conference is left or switched, the local
participant's id will be equal to the default value.

The problem fixed by this commit is a situation where the local
participant may end up sharing the same ID with it's "ghost" when
rejoining a disconnected conference. The most important and easiest to
hit case is when the conference is left after the CONFERENCE_FAILED
event.

Another rare and harder to encounter in the real world issue is
where CONFERENCE_LEFT may come with the delay due to it's asynchronous
nature. The step by step scenario is as follows: trying to leave a
conference, but the network is not doing well, so it takes time,
requests are timing out. After getting back to the welcome page the
the CONFERENCE_LEFT has not arrived yet. The same conference is joined
again and the load config may timeout, but it will be read from the
cache. Now the network gets better and conference is joining which
results in our ghost participant added to the redux state. At this point
there's the root issue: two participants with the same id, because the
local one was neither cleared nor set to the new one yet
(PARTICIPANT_JOINED come, before CONFERENCE_JOINED where we adjust the
id). Then comes CONFERENCE_JOINED and we try to update our local id.
We're updating the ID of both ghost and local participant. It could be
also that the delayed CONFERENCE_LEFT comes for the old conference, but
it's too late and it would update the id for both participants.

The approach here reasons that the ID of the local participant
may be reset as soon as the local participant and, respectively, her ID
is no longer involved in a recoverable JitsiConference of interest to
the user and, consequently, the app.

Co-authored-by: Pawel Domas <pawel.domas@jitsi.org>
Co-authored-by: Lyubo Marinov <lmarinov@atlassian.com>
2018-05-29 13:44:06 +02:00
Daniel Ornelas 72487fa7c7 [iOS] Custom CallKit display name
Add ability to provide a display name in the configOverwrite object that
when available it will be used to customize the name of the meeting in
callkit screen and recent call list.

Co-authored-by: Daniel Ornelas <daniel.ob64@gmail.com>
Co-authored-by: Lyubo Marinov <lmarinov@atlassian.com>
2018-05-28 18:53:48 -05:00
Lyubo Marinov 592305df74 [RN] Fix processing outdated loadConfig requests (continued)
Co-authored-by: Lyubo Marinov <lmarinov@atlassian.com>
Co-authored-by: Paweł Domas <pawel.domas@jitsi.org>
2018-05-23 16:48:23 -05:00
Lyubo Marinov 2ecacf6c3e [RN] Fix a "TypeError: Cannot read property handlers of undefined" in ImageCache
With some of the preceding commits in the "multiplying remote
thumbnails" story line, I started hitting this error with 100%
reproducibility:

1. Have a remote participant prepared in conferenceA. Web will do as
well.
2. On iOS prepare to join conferenceB in Safari and use the same device
for step 3.
3. Join conferenceA on the iOS device from step 2 with audio-only. The
audio-only is so that avatars are always visible. Wait for the remote
participant prepared in step 1 to appear.
4. Switch to Safari and hit "Continue in the app" to have the app leave
conferenceA and join conferenceB.

What happens:
After the iOS device joins conferenceB in the Jitsi Meet app, the local
participant is on the large video (as expected) but the avatar of the
local participant is the default audo-generated auto-colored
placeholder. That's because this error was hit and the avatar couldn't
be "fetched".
2018-05-23 10:26:59 -05:00
Bettenbuk Zoltan 180141cefb [RN] Fix ios audio issue with locked rooms 2018-05-17 10:43:48 +02:00
Lyubo Marinov 447035c8b2 Coding style 2018-05-15 14:12:39 -05:00
Lyubo Marinov 7fe421aeba Removes unnecessary source code 2018-05-15 14:12:38 -05:00
Lyubo Marinov 3aff4967f1 Keep buttons in their associated features
Contributing all buttons in one place goes against the designs that we
set out at the beginning of the project's rewrite and that multiple of
us have been following since then.
2018-05-15 14:12:38 -05:00
Saúl Ibarra Corretgé a2834a2495 [RN] Refactor Toolbox
Create standalone components for each feature and move all state to them.
Toolbars are now dummy containers.
2018-05-15 14:12:38 -05:00
Lyubo Marinov bd7c9473e7 [Android] Fix possible TypeError in multi-JitsiMeetView SDK consumers
If multiple JitsiMeetView instances are created (not necessarily
existing at once), it's possible to hit a TypeError when reading the
React Component props of the currently mounted App. Anyway, in certain
places we're already protecting against that out of abundance of caution
so it makes no sense to not protect everywhere.
2018-05-09 23:45:24 -05:00
Saúl Ibarra Corretgé 4fdd71d1bd [RN] Refactor SimpleBottomSheet
Make it more generic by accepting any content except of just rows with text and
icons.

In addition, rework its structure so the animation is smoother, by putting the
background overlay outside of the Modal. This way, the animation doesn't affect
the background, which won't slide down.
2018-05-08 22:25:25 +02:00
paweldomas 36ecc99b5b fix(auth/external API): CONFERENCE_FAILED with login dialog
Delay the CONFERENCE_FAILED event until the user cancels the login
dialog using the 'recoverable' event flag.
2018-05-04 13:02:19 +02:00
paweldomas 82f5eb894b ref(external API): emit CONFERENCE_FAILED on CONNECTION_FAILED
It seems that the external API will not send any event to let the sdk
consumer know that the conference has failed if the problem occurs at
the establishing of XMPP connection stage. That's because the config was
loaded successfully, but the conference instance does not exist yet, so
neither base/config nor base/conference will emit any failure.
2018-05-04 13:02:19 +02:00
paweldomas 91a65735f9 ref(external API): emit CONFERENCE_WILL_JOIN on SET_ROOM
Make the external API emit CONFERENCE_WILL_JOIN early on SET_ROOM action
which occurs before the XMPP connection is created. At this point we
know that config has loaded and if there's a valid conference room to
be joined. We were thinking of doing that even on CONFIG_WILL_LOAD,
but that seemed to be to risky at this point.
2018-05-04 13:02:19 +02:00
Lyubo Marinov 5e79bbecef Codying style: naming, formatting, comments 2018-05-03 18:04:59 -05:00
Daniel Ornelas e5309a6482 [iOS] Proxy CallKit API to be a feature of the SDK
With this the RN component and the consumer app can share same CallKit
provider, configuration, and enable to be part of multiple listeners of
the CallKit flow events. The main driver of this is to enable the
consumer app to be able to report an incoming call to the OS before
loading the JitsiMeetView. Once the user answers the call, the app can
instantiate a JitsiMeetView, pass the CallKit call UUIID, and the Jitsi
Meet components will handle the connection and report back to CallKit
that the  call has been established.
2018-05-03 18:04:59 -05:00
paweldomas 17ae89a56c ref(PiP/actions): remove 'is ok to enter PiP' check
Currently enterPictureInPicture action can only be dispatched when
the app is on the conference view and the enter PiP button is displayed,
so no check should be necessary.
2018-05-02 17:06:24 +02:00
paweldomas 565fd37f28 fix(Android|PiP): do not invoke 'enterPictureInPicture' in PAUSED state
Activity.enterPictureInPictureMode method must be invoked synchronously
on userLeaveHint callback in order to be sure that the current Activity
is still visible (does not transit to PAUSED state). Previously if the
asynchronous processing would be delayed enough for the Activity to go
into the PAUSED state it will be too late to go into the PiP mode.
2018-05-02 17:06:24 +02:00
Lyubo Marinov effd3728b6 [RN] add support for inviting participants during a call on mobile (2) 2018-05-02 12:54:02 +02:00
Ryan Peck f64c13d4b7 [RN] add support for inviting participants during a call on mobile
* Button conditionally shown based on if the feature is enabled and available
* Hooks for launching the invite UI (delegates to the native layer)
* Hooks for using the search and dial out checks from the native layer (calls back into JS)
* Hooks for handling sending invites and passing any failures back to the native layer
* Android and iOS handling for those hooks

Author: Ryan Peck <rpeck@atlassian.com>
Author: Eric Brynsvold <ebrynsvold@atlassian.com>
2018-04-25 18:58:06 +02:00
paweldomas 9cbcbf6e26 fix(PictureInPictureModule): catch the RuntimeException
Activity.enterPictureInPictureMode can fail for a couple of reasons
mentioned in the JSDoc:

"The system may disallow entering picture-in-picture in various cases,
including when the activity is not visible, if the screen is locked or
if the user has an activity pinned."

It seems to be safe to assume that those cases will be caught by
a RuntimeException handler (only RuntimeExceptions can be left without
explicit catch block).

Anyway the root cause for problems is the fact that the current process
for going to the picture in picture mode is not synchronised with
Activity's lifecycle. On Activity's "userLeaveHint" callback we dispatch
async task to the JS code which only then after dispatching some more
stuff eventually call native method that enter PiP. In case we spend too
much time on the JS side and the Activity goes to PAUSED state the call
will fail with IllegalStatException: "activity is not visible",
"activity is paused" etc. This means with this fix the app will not
crash, but we'll see it sometimes not go to the PiP mode as expected.
2018-04-22 00:41:18 -05:00
Lyubo Marinov f1ab160c62 Coding style: formatting, naming 2018-04-15 23:16:44 -05:00
virtuacoplenny 01db70fd3d
Merge pull request #2636 from zbettenbuk/calendar-permission-fix
Reorganize calendar access request flow
2018-03-26 07:57:24 -07:00
zbettenbuk b258e0d397 Reorganize calendar access request flow 2018-03-23 07:53:36 +01:00
Daniel Ornelas f8163de765 Implement Jitsi meet presentation interface that supports custom PiP solution 2018-03-21 22:00:43 -04:00
Lyubo Marinov a30412ba65 [RN] Automatically dispatch CONFERENCE_LEFT 2018-03-04 19:28:44 -06:00
Lyubo Marinov b8de5bbfc3 [RN] Add Picture-in-Picture support (Coding style: naming, consistency) 2018-02-23 11:21:26 -06:00
Saúl Ibarra Corretgé b3683068d4 [RN] Add Picture-in-Picture support
This only works automatically on Android >= 8. On other platforms / versions, it
relies on the SDK user on implementing a "reduced UI" mode and reacting to the
"request PIP" delegate method.
2018-02-23 11:21:25 -06:00
Lyubo Marinov e2cf7a788d [RN] Make full-screen more resilient on Android (Coding style: consistency) 2018-02-14 12:28:22 -06:00
Saúl Ibarra Corretgé 4757c1ebca [RN] Make full-screen more resilient on Android
On Android we go into "immersive mode" when in a conference, this is our way of
being full-creen. There are occasions, however, in which Android takes us out of
immerfive mode without us (the application / SDK) knowing: when a child activity
is started, a modal window shown, etc.

In order to be resilient to any possible change in the immersive mode, register
a listener which will be called when Android changes it, so we can re-eavluate
if we need it and thus re-enable it.
2018-02-13 15:00:36 -06:00
Saúl Ibarra Corretgé 7a9ff9975a [RN] Adjust Conference for the reduced UI mode 2018-02-13 11:59:12 -06:00
Saúl Ibarra Corretgé 78fbfba573 [iOS] Fix initial CallKit muted state
Turns out this was a bit more involved than I originally thought due to an
interesting (corner) case: IFF the user was never asked about microphone
permissions and the call starts with audio muted, unmuting from the CallKit
interface won't work (iOS won't show the prompt, it fails immediately) and we
need to sync the mute state back.
2018-02-06 10:24:06 -06:00
Saúl Ibarra Corretgé 292f3ab1bd [Android] Fix crash if settings activity cannot be opened
The documentation states this is possible, so make sure we handle such errors.

Ref:
https://developer.android.com/reference/android/provider/Settings.html#ACTION_APPLICATION_DETAILS_SETTINGS
2018-01-09 13:12:53 -06:00