release video after end card reached. fixes video call retry

This commit is contained in:
Daniel Gultsch 2020-04-29 09:22:49 +02:00
parent 333f509e53
commit 54ca3fb020
1 changed files with 5 additions and 1 deletions

View File

@ -645,7 +645,9 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
private void updateVideoViews(final RtpEndUserState state) { private void updateVideoViews(final RtpEndUserState state) {
if (END_CARD.contains(state) || state == RtpEndUserState.ENDING_CALL) { if (END_CARD.contains(state) || state == RtpEndUserState.ENDING_CALL) {
binding.localVideo.setVisibility(View.GONE); binding.localVideo.setVisibility(View.GONE);
binding.localVideo.release();
binding.remoteVideo.setVisibility(View.GONE); binding.remoteVideo.setVisibility(View.GONE);
binding.remoteVideo.release();
binding.pipLocalMicOffIndicator.setVisibility(View.GONE); binding.pipLocalMicOffIndicator.setVisibility(View.GONE);
if (isPictureInPicture()) { if (isPictureInPicture()) {
binding.appBarLayout.setVisibility(View.GONE); binding.appBarLayout.setVisibility(View.GONE);
@ -811,7 +813,9 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
updateProfilePicture(state, contact); updateProfilePicture(state, contact);
}); });
if (END_CARD.contains(state)) { if (END_CARD.contains(state)) {
resetIntent(account, with, state, requireRtpConnection().getMedia()); final JingleRtpConnection rtpConnection = requireRtpConnection();
resetIntent(account, with, state, rtpConnection.getMedia());
releaseVideoTracks(rtpConnection);
this.rtpConnectionReference = null; this.rtpConnectionReference = null;
} }
} else { } else {