openvidu-ionic: added improvements
This commit is contained in:
parent
8816371c83
commit
0699736873
@ -248,7 +248,7 @@ export class AppComponent implements OnDestroy {
|
||||
{
|
||||
name: 'url',
|
||||
type: 'text',
|
||||
value: 'https://demos.openvidu.io:4443',
|
||||
value: 'https://demos.openvidu.io',
|
||||
placeholder: 'URL'
|
||||
},
|
||||
{
|
||||
@ -291,7 +291,7 @@ export class AppComponent implements OnDestroy {
|
||||
getToken(): Promise<string> {
|
||||
if (this.platform.is('ios') && this.platform.is('cordova') && this.OPENVIDU_SERVER_URL === 'https://localhost:4443') {
|
||||
// To make easier first steps with iOS apps, use demos OpenVidu Sever if no custom valid server is configured
|
||||
this.OPENVIDU_SERVER_URL = 'https://demos.openvidu.io:4443';
|
||||
this.OPENVIDU_SERVER_URL = 'https://demos.openvidu.io';
|
||||
}
|
||||
return this.createSession(this.mySessionId).then((sessionId) => {
|
||||
return this.createToken(sessionId);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { StreamManager } from 'openvidu-browser';
|
||||
|
||||
|
||||
@ -29,19 +29,26 @@ import { StreamManager } from 'openvidu-browser';
|
||||
template: `
|
||||
<div>
|
||||
<ov-video [streamManager]="streamManager"></ov-video>
|
||||
<div><p>{{getNicknameTag()}}</p></div>
|
||||
<div><p>{{nickname}}</p></div>
|
||||
</div>`,
|
||||
})
|
||||
export class UserVideoComponent {
|
||||
export class UserVideoComponent implements OnInit {
|
||||
|
||||
nickname = '';
|
||||
|
||||
@Input()
|
||||
streamManager: StreamManager;
|
||||
|
||||
ngOnInit() {
|
||||
this.getNicknameTag();
|
||||
}
|
||||
|
||||
getNicknameTag() {
|
||||
try {
|
||||
return JSON.parse(this.streamManager.stream.connection.data).clientData;
|
||||
this.nickname = JSON.parse(this.streamManager.stream.connection.data).clientData;
|
||||
} catch (err) {
|
||||
console.error('ClientData is not JSON formatted');
|
||||
this.nickname = 'unknown';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user