Skip to content

Commit

Permalink
fix(call): add localvideotrack and emit remote video track
Browse files Browse the repository at this point in the history
  • Loading branch information
sreenara committed Sep 6, 2023
1 parent 2ec314f commit 45e2038
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/calling/calling/src/CallingClient/calling/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1932,7 +1932,7 @@ export class Call extends Eventing<CallEventTypes> implements ICall {
},
},
{
localTracks: {audio: localAudioTrack},
localTracks: {audio: localAudioTrack, video: localVideoTrack},
direction: {
audio: 'sendrecv',
video: 'sendrecv',
Expand Down Expand Up @@ -2449,6 +2449,12 @@ export class Call extends Eventing<CallEventTypes> implements ICall {
this.mediaConnection.on(Event.REMOTE_TRACK_ADDED, (e: any) => {
if (e.type === MEDIA_CONNECTION_EVENT_KEYS.MEDIA_TYPE_AUDIO) {
this.emit(EVENT_KEYS.REMOTE_MEDIA, e.track);
} else {
log.info(`Emitting Remote Video event for track type : ${e.type} ${e.track}`, {
file: CALL_FILE,
method: 'mediaTrackListener',
});
this.emit(EVENT_KEYS.REMOTE_VIDEO, e.track);
}
});
}
Expand Down
2 changes: 2 additions & 0 deletions packages/calling/calling/src/Events/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export enum EVENT_KEYS {
OUTGOING_CALL = 'callingClient:outgoing_call',
PROGRESS = 'call:progress',
REMOTE_MEDIA = 'call:remote_media',
REMOTE_VIDEO = 'call:remote_video',
RESUME_ERROR = 'call:resume_error',
RESUMED = 'call:resumed',
TRANSFER_ERROR = 'call:transfer_error',
Expand Down Expand Up @@ -171,6 +172,7 @@ export type CallEventTypes = {
[EVENT_KEYS.INCOMING_CALL]: (callObj: ICall) => void;
[EVENT_KEYS.PROGRESS]: (callId: CallId) => void;
[EVENT_KEYS.REMOTE_MEDIA]: (track: MediaStreamTrack) => void;
[EVENT_KEYS.REMOTE_VIDEO]: (track: MediaStreamTrack) => void;
[EVENT_KEYS.RESUME_ERROR]: (error: CallError) => void;
[EVENT_KEYS.RESUMED]: (callId: CallId) => void;
[EVENT_KEYS.TRANSFER_ERROR]: (error: CallError) => void;
Expand Down

0 comments on commit 45e2038

Please sign in to comment.