mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-17 09:45:02 +01:00
Fix #162 and a few other bugs
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
8d409cd4d6
commit
078115d478
@ -51,6 +51,7 @@ import com.nextcloud.talk.api.NcApi;
|
||||
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
||||
import com.nextcloud.talk.controllers.base.BaseController;
|
||||
import com.nextcloud.talk.events.MediaStreamEvent;
|
||||
import com.nextcloud.talk.events.PeerConnectionEvent;
|
||||
import com.nextcloud.talk.events.SessionDescriptionSendEvent;
|
||||
import com.nextcloud.talk.models.database.UserEntity;
|
||||
import com.nextcloud.talk.models.json.call.CallOverall;
|
||||
@ -70,12 +71,12 @@ import com.nextcloud.talk.models.json.signaling.SignalingOverall;
|
||||
import com.nextcloud.talk.models.json.signaling.settings.IceServer;
|
||||
import com.nextcloud.talk.models.json.signaling.settings.SignalingSettingsOverall;
|
||||
import com.nextcloud.talk.utils.ApiUtils;
|
||||
import com.nextcloud.talk.utils.singletons.ApplicationWideCurrentRoomHolder;
|
||||
import com.nextcloud.talk.utils.animations.PulseAnimation;
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
||||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||
import com.nextcloud.talk.utils.glide.GlideApp;
|
||||
import com.nextcloud.talk.utils.preferences.AppPreferences;
|
||||
import com.nextcloud.talk.utils.singletons.ApplicationWideCurrentRoomHolder;
|
||||
import com.nextcloud.talk.webrtc.MagicAudioManager;
|
||||
import com.nextcloud.talk.webrtc.MagicPeerConnectionWrapper;
|
||||
import com.nextcloud.talk.webrtc.MagicWebRTCUtils;
|
||||
@ -165,6 +166,8 @@ public class CallController extends BaseController {
|
||||
FlipView cameraControlButton;
|
||||
@BindView(R.id.call_control_switch_camera)
|
||||
FlipView cameraSwitchButton;
|
||||
@BindView(R.id.connectingTextView)
|
||||
TextView connectingTextView;
|
||||
|
||||
@BindView(R.id.connectingRelativeLayoutView)
|
||||
RelativeLayout connectingView;
|
||||
@ -743,14 +746,15 @@ public class CallController extends BaseController {
|
||||
}
|
||||
|
||||
private void startCall() {
|
||||
if (!isPTTActive) {
|
||||
animateCallControls(false, 7500);
|
||||
}
|
||||
startPullingSignalingMessages();
|
||||
}
|
||||
|
||||
private void animateCallControls(boolean show, long startDelay) {
|
||||
if (!isPTTActive) {
|
||||
if (isVoiceOnlyCall) {
|
||||
if (spotlightView != null && spotlightView.getVisibility() != View.GONE) {
|
||||
spotlightView.setVisibility(View.GONE);
|
||||
}
|
||||
} else if (!isPTTActive) {
|
||||
float alpha;
|
||||
long duration;
|
||||
|
||||
@ -979,6 +983,10 @@ public class CallController extends BaseController {
|
||||
connectingView.setVisibility(View.GONE);
|
||||
conversationView.setVisibility(View.VISIBLE);
|
||||
|
||||
if (!isPTTActive) {
|
||||
animateCallControls(false, 5000);
|
||||
}
|
||||
|
||||
ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomId(roomId);
|
||||
ApplicationWideCurrentRoomHolder.getInstance().setInCall(true);
|
||||
ApplicationWideCurrentRoomHolder.getInstance().setUserInRoom(userEntity);
|
||||
@ -1400,6 +1408,36 @@ public class CallController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMessageEvent(PeerConnectionEvent peerConnectionEvent) {
|
||||
if (peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent.PeerConnectionEventType
|
||||
.PEER_CLOSED)) {
|
||||
endPeerConnection(peerConnectionEvent.getSessionId());
|
||||
} else if (peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent
|
||||
.PeerConnectionEventType.SENSOR_FAR) ||
|
||||
peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent
|
||||
.PeerConnectionEventType.SENSOR_NEAR)) {
|
||||
boolean enableVideo = peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent
|
||||
.PeerConnectionEventType.SENSOR_FAR) && videoOn;
|
||||
if (getActivity() != null && EffortlessPermissions.hasPermissions(getActivity(), PERMISSIONS_CAMERA) &&
|
||||
inCall && videoOn
|
||||
&& enableVideo != localVideoTrack.enabled()) {
|
||||
toggleMedia(enableVideo, true);
|
||||
}
|
||||
} else if (peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent
|
||||
.PeerConnectionEventType.NICK_CHANGE)) {
|
||||
gotNick(peerConnectionEvent.getSessionId(), peerConnectionEvent.getNick());
|
||||
} else if (peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent
|
||||
.PeerConnectionEventType.VIDEO_CHANGE) && !isVoiceOnlyCall) {
|
||||
gotAudioOrVideoChange(true, peerConnectionEvent.getSessionId(),
|
||||
peerConnectionEvent.getChangeValue());
|
||||
} else if (peerConnectionEvent.getPeerConnectionEventType().equals(PeerConnectionEvent
|
||||
.PeerConnectionEventType.AUDIO_CHANGE)) {
|
||||
gotAudioOrVideoChange(false, peerConnectionEvent.getSessionId(),
|
||||
peerConnectionEvent.getChangeValue());
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMessageEvent(MediaStreamEvent mediaStreamEvent) {
|
||||
if (mediaStreamEvent.getMediaStream() != null) {
|
||||
|
@ -54,7 +54,8 @@
|
||||
android:layout_margin="16dp"
|
||||
android:text="@string/nc_connecting_call"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/white"/>
|
||||
android:textColor="@color/white"
|
||||
android:id="@+id/connectingTextView"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user