MediaProfileSpecType mediaProfileSpecType = MediaProfileSpecType.WEBM;
final String contentId = contentSession.getContentId();
if (contentId != null && contentId.equalsIgnoreCase("mp4")) {
mediaProfileSpecType = MediaProfileSpecType.MP4;
}
recorderEndPoint = mp.newRecorderEndpoint(TARGET)
.withMediaProfile(mediaProfileSpecType).build();
WebRtcEndpoint webRtcEndpoint = mp.newWebRtcEndpoint().build();
webRtcEndpoint.connect(webRtcEndpoint);
webRtcEndpoint.connect(recorderEndPoint);