openvidu-testapp: default url to location.hostname

pull/173/head
pabloFuente 2018-11-21 14:32:59 +01:00
parent 5286da813a
commit bd0d4a82c0
3 changed files with 6 additions and 5 deletions

View File

@ -9,7 +9,7 @@ import { OpenviduParamsService } from './services/openvidu-params.service';
}) })
export class AppComponent { export class AppComponent {
openviduURL = 'https://localhost:4443/'; openviduURL = 'https://' + window.location.hostname + ':4443/';
openviduSecret = 'MY_SECRET'; openviduSecret = 'MY_SECRET';
constructor(private router: Router, private openviduParamsService: OpenviduParamsService) { } constructor(private router: Router, private openviduParamsService: OpenviduParamsService) { }

View File

@ -229,6 +229,7 @@ export class OpenviduInstanceComponent implements OnInit, OnChanges, OnDestroy {
}) })
.catch(error => { .catch(error => {
console.log('There was an error connecting to the session:', error.code, error.message); console.log('There was an error connecting to the session:', error.code, error.message);
alert('Error connecting to the session: ' + error.message);
}); });
} }

View File

@ -11,7 +11,7 @@ export class OpenviduParamsService {
params: OpenviduParams = params: OpenviduParams =
{ {
openviduUrl: 'https://localhost:4443/', openviduUrl: 'https://' + window.location.hostname + ':4443/',
openviduSecret: 'MY_SECRET' openviduSecret: 'MY_SECRET'
}; };