Skip to content

Commit

Permalink
OpenVidu Server URL discovery update
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloFuente committed Oct 3, 2018
1 parent af40814 commit 4e721a6
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions front/openvidu-call/src/app/shared/services/open-vidu.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,8 @@ export class OpenViduService {
this.URL_OV = environment.openvidu_url;
this.MY_SECRET = environment.openvidu_secret;
} else {
let url_prod = 'https://' + location.hostname;
if (location.port) {
url_prod = url_prod + ':' + location.port;
}
this.URL_OV = environment.production ? url_prod : 'https://' + location.hostname + ':4443';
this.URL_OV = 'https://' + location.hostname + ':4443';
}

console.log('url environment', this.URL_OV);
}

Expand All @@ -43,7 +38,7 @@ export class OpenViduService {
'Authorization': 'Basic ' + btoa('OPENVIDUAPP:' + openviduSecret),
'Content-Type': 'application/json',
})
};
};
return this.http.post<any>(openviduServerUrl + '/api/sessions', body, options)
.pipe(
catchError(error => {
Expand All @@ -58,7 +53,7 @@ export class OpenViduService {
});
}

createToken(sessionId: string, openviduServerUrl: string, openviduSecret: string): Promise<string> {
createToken(sessionId: string, openviduServerUrl: string, openviduSecret: string): Promise<string> {
return new Promise((resolve, reject) => {

const body = JSON.stringify({ session: sessionId });
Expand Down

0 comments on commit 4e721a6

Please sign in to comment.