From bd0d4a82c0b33d079c8842d48f768cb623e8dda9 Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Wed, 21 Nov 2018 14:32:59 +0100 Subject: [PATCH] openvidu-testapp: default url to location.hostname --- openvidu-testapp/src/app/app.component.ts | 2 +- .../openvidu-instance/openvidu-instance.component.ts | 1 + .../src/app/services/openvidu-params.service.ts | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/openvidu-testapp/src/app/app.component.ts b/openvidu-testapp/src/app/app.component.ts index a57bf78d..38c3f41e 100644 --- a/openvidu-testapp/src/app/app.component.ts +++ b/openvidu-testapp/src/app/app.component.ts @@ -9,7 +9,7 @@ import { OpenviduParamsService } from './services/openvidu-params.service'; }) export class AppComponent { - openviduURL = 'https://localhost:4443/'; + openviduURL = 'https://' + window.location.hostname + ':4443/'; openviduSecret = 'MY_SECRET'; constructor(private router: Router, private openviduParamsService: OpenviduParamsService) { } diff --git a/openvidu-testapp/src/app/components/openvidu-instance/openvidu-instance.component.ts b/openvidu-testapp/src/app/components/openvidu-instance/openvidu-instance.component.ts index 42c584c1..fa8dad22 100644 --- a/openvidu-testapp/src/app/components/openvidu-instance/openvidu-instance.component.ts +++ b/openvidu-testapp/src/app/components/openvidu-instance/openvidu-instance.component.ts @@ -229,6 +229,7 @@ export class OpenviduInstanceComponent implements OnInit, OnChanges, OnDestroy { }) .catch(error => { console.log('There was an error connecting to the session:', error.code, error.message); + alert('Error connecting to the session: ' + error.message); }); } diff --git a/openvidu-testapp/src/app/services/openvidu-params.service.ts b/openvidu-testapp/src/app/services/openvidu-params.service.ts index bd4be953..84582c50 100644 --- a/openvidu-testapp/src/app/services/openvidu-params.service.ts +++ b/openvidu-testapp/src/app/services/openvidu-params.service.ts @@ -10,10 +10,10 @@ export interface OpenviduParams { export class OpenviduParamsService { params: OpenviduParams = - { - openviduUrl: 'https://localhost:4443/', - openviduSecret: 'MY_SECRET' - }; + { + openviduUrl: 'https://' + window.location.hostname + ':4443/', + openviduSecret: 'MY_SECRET' + }; newParams$ = new Subject();