Skip to content

Commit

Permalink
chore: deprecate video methods
Browse files Browse the repository at this point in the history
  • Loading branch information
farhat-ha committed Oct 14, 2024
1 parent b9b2756 commit 99336fa
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/js/src/Modules/Verto/BrowserSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ export default abstract class BrowserSession extends BaseSession {
* ```
*
* @returns Promise with an array of MediaDeviceInfo
* @deprecated
*/
getVideoDevices(): Promise<MediaDeviceInfo[]> {
return getDevices(DeviceType.Video).catch((error) => {
Expand Down Expand Up @@ -391,6 +392,7 @@ export default abstract class BrowserSession extends BaseSession {
* console.log(result);
* });
* ```
* @deprecated
*/
async getDeviceResolutions(deviceId: string) {
try {
Expand Down Expand Up @@ -545,6 +547,7 @@ export default abstract class BrowserSession extends BaseSession {
* height: 720
* })
* ```
* @deprecated
*/
async setVideoSettings(settings: IVideoSettings) {
if (!settings) {
Expand Down Expand Up @@ -586,6 +589,7 @@ export default abstract class BrowserSession extends BaseSession {
*
* client.disableWebcam();
* ```
* @deprecated
*/
disableWebcam() {
this._videoConstraints = false;
Expand All @@ -604,6 +608,7 @@ export default abstract class BrowserSession extends BaseSession {
*
* client.enableWebcam();
* ```
* @deprecated
*/
enableWebcam() {
this._videoConstraints = true;
Expand Down
4 changes: 4 additions & 0 deletions packages/js/src/Modules/Verto/webrtc/BaseCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ export default abstract class BaseCall implements IWebRTCCall {
* ```js
* call.muteVideo();
* ```
* @deprecated
*/
muteVideo() {
disableVideoTracks(this.options.localStream);
Expand All @@ -604,6 +605,7 @@ export default abstract class BaseCall implements IWebRTCCall {
* ```js
* call.unmuteVideo();
* ```
* @deprecated
*/
unmuteVideo() {
enableVideoTracks(this.options.localStream);
Expand All @@ -617,6 +619,7 @@ export default abstract class BaseCall implements IWebRTCCall {
* ```js
* call.toggleVideoMute();
* ```
* @deprecated
*/
toggleVideoMute() {
toggleVideoTracks(this.options.localStream);
Expand Down Expand Up @@ -653,6 +656,7 @@ export default abstract class BaseCall implements IWebRTCCall {
*
* @param deviceId the target video device ID
* @returns Promise that resolves if the video device has been updated
* @deprecated
*/
async setVideoDevice(deviceId: string): Promise<void> {
const { instance } = this.peer;
Expand Down
9 changes: 8 additions & 1 deletion packages/js/src/Modules/Verto/webrtc/Call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ import { IVertoCallOptions } from './interfaces';
export class Call extends BaseCall {
public screenShare: Call;


private _statsInterval: any = null;

hangup(params: any = {}, execute: boolean = true) {
Expand All @@ -63,6 +62,10 @@ export class Call extends BaseCall {
super.hangup(params, execute);
}

/**
* @deprecated
* @private
*/
async startScreenShare(opts?: IVertoCallOptions) {
const displayStream: MediaStream = await getDisplayMedia({ video: true });
displayStream.getTracks().forEach((t) => {
Expand All @@ -89,6 +92,10 @@ export class Call extends BaseCall {
return this.screenShare;
}

/**
* @deprecated
* @private
*/
stopScreenShare() {
if (this.screenShare instanceof Call) {
this.screenShare.hangup();
Expand Down

0 comments on commit 99336fa

Please sign in to comment.