Partly fix notifications

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-05-29 14:34:37 +02:00
parent 3d41e926a3
commit ae8057e405
2 changed files with 33 additions and 11 deletions

View file

@ -501,9 +501,9 @@ public class CallActivity extends AppCompatActivity {
if (b && cameraSwitchCount != -1) {
if (cameraSwitchCount == camerasCount) {
cameraSwitchCount = 0;
pipVideoView.setMirror(true);
} else {
pipVideoView.setMirror(false);
} else {
pipVideoView.setMirror(true);
}
}
}
@ -688,7 +688,7 @@ public class CallActivity extends AppCompatActivity {
//Create a new PeerConnectionFactory instance.
PeerConnectionFactory.Options options = new PeerConnectionFactory.Options();
peerConnectionFactory = new PeerConnectionFactory(options);
peerConnectionFactory = PeerConnectionFactory.builder().createPeerConnectionFactory();
peerConnectionFactory.setVideoHwAccelerationOptions(rootEglBase.getEglBaseContext(),
rootEglBase.getEglBaseContext());
@ -745,11 +745,7 @@ public class CallActivity extends AppCompatActivity {
localMediaStream.addTrack(localVideoTrack);
localVideoTrack.setEnabled(false);
//create a videoRenderer based on SurfaceViewRenderer instance
localRenderer = new VideoRenderer(pipVideoView);
// And finally, with our VideoRenderer ready, we
// can add our renderer to the VideoTrack.
localVideoTrack.addRenderer(localRenderer);
localVideoTrack.addSink(pipVideoView);
}
}
@ -1405,8 +1401,7 @@ public class CallActivity extends AppCompatActivity {
if (mediaStream != null && mediaStream.videoTracks != null && mediaStream.videoTracks.size() > 0 && enable) {
VideoTrack videoTrack = mediaStream.videoTracks.get(0);
VideoRenderer remoteRenderer = new VideoRenderer(surfaceViewRenderer);
videoTrack.addRenderer(remoteRenderer);
videoTrack.addSink(surfaceViewRenderer);
imageView.setVisibility(View.INVISIBLE);
surfaceViewRenderer.setVisibility(View.VISIBLE);

View file

@ -405,7 +405,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
inChat = false;
dispose();
ApplicationWideCurrentRoomHolder.getInstance().clear();
super.onDestroy();
leaveRoom();
}
private void dispose() {
@ -488,6 +488,33 @@ public class ChatController extends BaseController implements MessagesListAdapte
}
}
private void leaveRoom() {
ncApi.leaveRoom(credentials, ApiUtils.getUrlForRoomParticipants(baseUrl, roomToken))
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<GenericOverall>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(GenericOverall genericOverall) {
getRouter().popCurrentController();
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
}
});
}
private void setSenderId() {
try {
final Field senderId = adapter.getClass().getDeclaredField("senderId");