Skip to content

Commit

Permalink
layout design for video call
Browse files Browse the repository at this point in the history
  • Loading branch information
mateen777 committed Oct 21, 2024
1 parent b511daf commit 3320cba
Show file tree
Hide file tree
Showing 23 changed files with 3,346 additions and 134 deletions.
38 changes: 35 additions & 3 deletions src/app/core/constants/apiRestRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,39 @@ export enum AuthEndPoints {
register = "/users"
}

export enum Webrtc {
broadcast = '/broadcast',
consumer = '/consumer'
export enum SocketEvents {
// create a room
CREATE_ROOM = "createRoom",
// join in the room
JOIN_ROOM = "joinRoom",
// new Peer
NEW_PEER = "newPeer",
// get All Peers
GET_PEERS = "getAllPeers",
//get RouterRtpCapabilities of the room
GET_ROUTER_RTPCAPABILITIES = "getRouterRtpCapabilities",
//create createWebRtcTransport transport
CREATE_WEBRTC_TRANSPORT = "createWebRtcTransport",
//connect transport
CONNECT_TRANSPORT = "connectTransport",
//produce
PRODUCE = "produce",
//consume
CONSUME = "consume",
//close the producer of the room
PRODUCER_CLOSED = "producerClosed",
//pause the producer of the room
PAUSE_PRODUCER = "pauseProducer",
//resume the producer of the room
RESUME_PRODUCER = "resumeProducer",
//resume the consumer of the room
RESUME_CONSUMER = "resumeConsumer",
//get producers of the room
GET_PRODUCERS = "getProducers",
//remove the peer of the room for server side event
EXIT_ROOM = "exitRoom",
//remove the peer of the room for client side event
PEER_CLOSED = "peerClosed",
//new producers for room
NEW_PRODUCERS = "newProducers",
}
2 changes: 1 addition & 1 deletion src/app/core/services/call.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class CallService {
}

getSessionId(): Observable<any> {
return this.http.requestCall('/sessions', ApiMethod.POST);
return this.http.requestCall('/sessions', ApiMethod.POST,{});
}

getTokens(sessionId:any,nickname:any):any {
Expand Down
10 changes: 5 additions & 5 deletions src/app/core/services/http.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ export class HttpService {

constructor(private http:HttpClient) { }

requestCall(apiEndpoint:any,method:ApiMethod,data?:any){
requestCall(apiEndpoint:any,method:ApiMethod,body:any,options?:any){
let response:any;

switch (method) {
case ApiMethod.GET:
response = this.http.get<any>(`${environment.url}${apiEndpoint}`).pipe(
response = this.http.get<any>(`${environment.url}${apiEndpoint}`,options).pipe(
catchError((err)=> this.handleError(err)))
break;

case ApiMethod.POST:
response = this.http.post<any>(`${environment.url}${apiEndpoint}`,data).pipe(
response = this.http.post<any>(`${environment.url}${apiEndpoint}`,body,options).pipe(
catchError((err)=> this.handleError(err)))
break;

case ApiMethod.PUT:
response = this.http.put<any>(`${environment.url}${apiEndpoint}`,data).pipe(
response = this.http.put<any>(`${environment.url}${apiEndpoint}`,body,options).pipe(
catchError((err)=> this.handleError(err)))
break;

case ApiMethod.DELETE:
response = this.http.delete<any>(`${environment.url}${apiEndpoint}`).pipe(
response = this.http.delete<any>(`${environment.url}${apiEndpoint}`,options).pipe(
catchError((err)=> this.handleError(err)))
break;
default:
Expand Down
16 changes: 16 additions & 0 deletions src/app/core/services/mediasoup.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* tslint:disable:no-unused-variable */

import { TestBed, async, inject } from '@angular/core/testing';
import { MediasoupService } from './mediasoup.service';

describe('Service: Mediasoup', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [MediasoupService]
});
});

it('should ...', inject([MediasoupService], (service: MediasoupService) => {
expect(service).toBeTruthy();
}));
});
Loading

0 comments on commit 3320cba

Please sign in to comment.