Skip to content

Commit

Permalink
Put back the code in onHostResume
Browse files Browse the repository at this point in the history
  • Loading branch information
Alvaro Nicoli authored and Alvaro Nicoli committed May 30, 2019
1 parent 6b9e743 commit f1e2345
Showing 1 changed file with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,33 @@ public void onError(int i) {

@Override
public void onHostResume() {
Log.i("CustomTwilioVideoView", "Host resume does nothing!!");
/*
* In case it wasn't set.
*/
if (themedReactContext.getCurrentActivity() != null) {
/*
* If the local video track was released when the app was put in the background, recreate.
*/
if (cameraCapturer != null && localVideoTrack == null) {
localVideoTrack = LocalVideoTrack.create(getContext(), true, cameraCapturer, buildVideoConstraints());
}

if (localVideoTrack != null) {
if (thumbnailVideoView != null) {
localVideoTrack.addRenderer(thumbnailVideoView);
}

/*
* If connected to a Room then share the local video track.
*/
if (localParticipant != null) {
localParticipant.publishTrack(localVideoTrack);
}
}

themedReactContext.getCurrentActivity().setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);

}
}

@Override
Expand Down

0 comments on commit f1e2345

Please sign in to comment.