mirror of https://github.com/OpenVidu/openvidu.git
openvidu-testapp: update test-scenarios component
parent
b92548c504
commit
49e2e87f69
|
@ -213,16 +213,7 @@ export class TestScenariosComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
this.testFeedService.pushNewEvent({ user: 0, event });
|
this.testFeedService.pushNewEvent({ user: 0, event });
|
||||||
|
|
||||||
const subscriber = session.subscribe(event.stream, undefined, (error) => {
|
const subscriber = session.subscribe(event.stream, undefined);
|
||||||
const subAux = this.subscribers
|
|
||||||
.find(s => s.connectionId === session.connection.connectionId).subs
|
|
||||||
.find(s => s.streamManager.stream.connection.connectionId === subscriber.stream.connection.connectionId);
|
|
||||||
if (!!error) {
|
|
||||||
subAux.state['errorConnecting'] = (Date.now() - startTimeForUser);
|
|
||||||
} else {
|
|
||||||
subAux.state['connected'] = (Date.now() - startTimeForUser);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const sub = this.subscribers.find(s => s.connectionId === session.connection.connectionId);
|
const sub = this.subscribers.find(s => s.connectionId === session.connection.connectionId);
|
||||||
if (!sub) {
|
if (!sub) {
|
||||||
|
@ -232,7 +223,7 @@ export class TestScenariosComponent implements OnInit, OnDestroy {
|
||||||
startTime: startTimeForUser,
|
startTime: startTimeForUser,
|
||||||
connectionId: session.connection.connectionId,
|
connectionId: session.connection.connectionId,
|
||||||
streamManager: subscriber,
|
streamManager: subscriber,
|
||||||
state: { 'connecting': (Date.now() - startTimeForUser) }
|
state: { 'connected': (Date.now() - startTimeForUser) }
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -240,7 +231,7 @@ export class TestScenariosComponent implements OnInit, OnDestroy {
|
||||||
startTime: startTimeForUser,
|
startTime: startTimeForUser,
|
||||||
connectionId: session.connection.connectionId,
|
connectionId: session.connection.connectionId,
|
||||||
streamManager: subscriber,
|
streamManager: subscriber,
|
||||||
state: { 'connecting': (Date.now() - startTimeForUser) }
|
state: { 'connected': (Date.now() - startTimeForUser) }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -294,8 +285,8 @@ export class TestScenariosComponent implements OnInit, OnDestroy {
|
||||||
this.sessionProperties.customSessionId = this.fixedSessionId;
|
this.sessionProperties.customSessionId = this.fixedSessionId;
|
||||||
}
|
}
|
||||||
return this.OV_NodeClient.createSession(this.sessionProperties)
|
return this.OV_NodeClient.createSession(this.sessionProperties)
|
||||||
.then(session_NodeClient => {
|
.then(async (session_NodeClient) => {
|
||||||
return session_NodeClient.generateToken();
|
return (await session_NodeClient.createConnection()).token;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue