matrix-js-sdk
matrix-js-sdk copied to clipboard
setRemoteAudioElement fails when remoteVideoElement has not been set
I am using the following code to create a voice call:
call = matrixcs.createNewMatrixCall(client, roomName);
call.remoteVideoElement = {};
call.setRemoteAudioElement(callAudiotag);
console.info("Call %s", call);
addCallListeners(call);
call.placeVoiceCall();
The problem is that unless I create a placeholder remoteVideoElement, such as empty object, the code fails. I shouldn't need to put remoteVideoElement when I have no use for it.
The problem is in this line in setRemoteAudioElement:
this.remoteVideoElement.muted = true;
Why not allow setting the audioTag in placeVoiceCall the same way it's done in placeVideoCall?