mirror of https://github.com/OpenVidu/openvidu.git
Connection undefined when leaving failed room bug fixed
parent
8923d169f2
commit
1e046f80c0
|
@ -275,13 +275,13 @@ Whatever app you are developing, chances are you will need to pass some data for
|
|||
|
||||
- **API REST**: when asking for a token to */newToken*, you can pass data as third parameter in the BODY of the POST request
|
||||
```
|
||||
{“0”: “sessionId”, “1”: “role”, “2”: "DATA"}
|
||||
{“session”: “sessionId”, “role”: “role”, “data”: "DATA"}
|
||||
```
|
||||
|
||||
> **openvidu-backend-client** allows you to pass data when creating a Token object: </br>
|
||||
> `Token t = new TokenOptions.Builder().data("DATA").build();`
|
||||
|
||||
The result will be that in all clients *Connection* objects will have in their *data* property the pertinent value you have provided for each user. So, an easy way to get the data associated to any user would be:
|
||||
The result will be that in all clients, *Connection* objects will have in their *data* property the pertinent value you have provided for each user. So, an easy way to get the data associated to any user would be:
|
||||
|
||||
```javascript
|
||||
session.on('streamCreated', function (event) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -30,8 +30,10 @@ export class Session {
|
|||
for (s of this.openVidu.openVidu.getRemoteStreams()) {
|
||||
s.removeVideo();
|
||||
}
|
||||
for (let streamId in this.connection.getStreams()) {
|
||||
this.connection.getStreams()[streamId].removeVideo();
|
||||
if (this.connection) {
|
||||
for (let streamId in this.connection.getStreams()) {
|
||||
this.connection.getStreams()[streamId].removeVideo();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -40,7 +40,8 @@ export class OpenViduInternal {
|
|||
|
||||
checkNgrokUri() {
|
||||
if (this.wsUri.indexOf(".ngrok.io") !== -1) {
|
||||
// OpenVidu server URL referes to a ngrok IP: delete port of URL
|
||||
// OpenVidu server URL referes to a ngrok IP: secure wss protocol and delete port of URL
|
||||
this.wsUri = this.wsUri.replace("ws://", "wss://");
|
||||
let regex = /\.ngrok\.io:\d+/;
|
||||
this.wsUri = this.wsUri.replace(regex, ".ngrok.io");
|
||||
} else if (this.wsUri.indexOf("localhost") !== -1) {
|
||||
|
|
Loading…
Reference in New Issue