When the chat view is shown in the main view the call UI (videos and
screens) is hidden using a CSS trick. However, when there is no chat
view in the main view the elements for videos and screens were always
visible. Those elements are initially "empty", but once the user joins a
call they are filled with contents (like the icon to mute the own audio,
or the avatar of the speaking user). As the elements were always visible
the call UI was shown in the main view after a room was left (either
explicitly or implicitly, for example, if the moderator deleted the
room), as in those cases there is no chat view hidding them.
Besides that, the empty content element was hidden when joining a call
but never shown back again. Due to that when a room was left after
joining a call the empty content element was also missing.
Now the videos, screens and empty content are explicitly shown or hidden
as needed when the user joins a call, leaves a call, or leaves a room,
just like it is done with the chat view.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Depending on timings it could happen that the guest name was set before
the room token was known (resulting in `null` in the url) or before the
user has joined the room (so setting the name got rejected).
Signed-off-by: Joachim Bauch <bauch@struktur.de>
This avoids a conflict (introduced by #864) with the existing ´usersChanged`
event which is triggered when the `inCall` status of a user has changed.
Signed-off-by: Joachim Bauch <bauch@struktur.de>
When explicitly leaving the current room through the room list view the
chat view was detached. However, as the internal state of the
Application object (which manages the placement of the chat view) was
not updated the chat view was always hidden from that point on until the
page was reloaded.
Moreover, as the chat view was detached only when explicitly leaving the
current room the chat view was not hidden for other users in the room if
it was deleted by a moderator.
As the "leaveCurrentRoom" event is triggered in the room channel when
the current room is left, either explicitly or implicitly, now the
Application object listens to that event and hides the chat view as
needed when it is received.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
When we delayed the media access, we were all fast with testing.
Before this patch, when there was already at least one user in the
call and you took longer to accept the media request than webrtc
took to init everything, you would always send a black video signal
and no sound, because the data was not there, when connections were
established with the other users. Now we first request the media and
send the join call to the server afterwards.
Signed-off-by: Joas Schilling <coding@schilljs.com>
When an element is detached and then attached again its scroll position
is reset to the top. Now the chat view provides the "saveScrollPosition"
and "restoreScrollPosition" methods to save the scroll position before
detaching its element and then restoring it when attached again.
Note that the position can not be exactly restored, as the size of the
chat view may have changed due to switching it from the main view to the
sidebar, and thus the visible messages can not be the same in both
cases. Due to this, restoring the scroll position just ensures that the
last message that was partially visible when it was saved will be fully
visible when it is restored.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
When the oldest on top layout was added it was enabled by default,
although the original newest on top layout was also kept as an option.
However, the newest on top layout has not been used since then, and it
is not expected to be used ever again. To make the chat view more
maintainable and ease adding new features this commit removes the
original newest on top chat layout.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Show previous message again, after media permissions was requested
* Always show message for media permission, not only on first connection
Signed-off-by: Joas Schilling <coding@schilljs.com>
a - toggle audio on/off
v - toggle video on/off
p - switch to participants tab
c - switch to chat tab
Signed-off-by: Joas Schilling <coding@schilljs.com>