diff --git a/src/client.js b/src/client.js index f344bce87..e99896792 100644 --- a/src/client.js +++ b/src/client.js @@ -729,6 +729,17 @@ MatrixClient.prototype.setSupportsCallTransfer = function(supportsCallTransfer) this._supportsCallTransfer = supportsCallTransfer; }; +/** + * Creates a new call. + * The place*Call methods on the returned call can be used to actually place a call + * + * @param {string} roomId The room the call is to be placed in. + * @return {MatrixCall} the call or null if the browser doesn't support calling. + */ +MatrixClient.prototype.createCall = function(roomId) { + return createNewMatrixCall(this, roomId); +}; + /** * Get the current sync state. * @return {?string} the sync state, which may be null. diff --git a/src/webrtc/call.ts b/src/webrtc/call.ts index 12b62c660..233c6e1fa 100644 --- a/src/webrtc/call.ts +++ b/src/webrtc/call.ts @@ -1936,6 +1936,9 @@ export function setAudioInput(deviceId: string) { audioInput = deviceId; } export function setVideoInput(deviceId: string) { videoInput = deviceId; } /** + * DEPRECATED + * Use client.createCall() + * * Create a new Matrix call for the browser. * @param {MatrixClient} client The client instance to use. * @param {string} roomId The room the call is in.