Metadata nullpointer bug fixed

pull/20/head
pabloFuente 2017-05-20 15:09:22 +02:00
parent e382ae4ad9
commit 369fddc682
5 changed files with 20 additions and 12 deletions

View File

@ -33,7 +33,7 @@ We have implemented a very basic demo application to see OpenVidu in action. To
- Run this Docker container - Run this Docker container
``` ```
docker run -p 8080:8080 -p 8443:8443 -e KMS_STUN_IP=193.147.51.12 -e KMS_STUN_PORT=3478 -e openvidu.security=false openvidu/openvidu-plainjs-demo docker run -p 8443:8443 -e KMS_STUN_IP=193.147.51.12 -e KMS_STUN_PORT=3478 -e openvidu.security=false openvidu/openvidu-plainjs-demo
``` ```
- Go to [`https://localhost:8443`](https://localhost:8443) and accept the self-signed certificate to enjoy your app. You should mute your speakers to avoid disruptive audio feedback. - Go to [`https://localhost:8443`](https://localhost:8443) and accept the self-signed certificate to enjoy your app. You should mute your speakers to avoid disruptive audio feedback.
@ -307,13 +307,13 @@ API reference
| Event | Properties | Description | | Event | Properties | Description |
| -----------------------| --------------------- | ---------------------------- | | -----------------------| --------------------- | ---------------------------- |
| `videoElementCreated` | element:HTMLVideoElement | Triggered by Publisher object inmediately after a new video element has been added to DOM | | `videoElementCreated` | element:HTMLVideoElement | Triggered by Subscriber object inmediately after a new video element has been added to DOM |
#### **Connection** #### **Connection**
| Property | Type | Description | | Property | Type | Description |
| ------------| ------ | ---------------------------- | | ------------| ------ | ---------------------------- |
| `connectionId` | string | Unique identifier of the connection | | `connectionId` | string | Unique identifier of the connection |
| `data` | string | Data associated to this connection (and therefore to the user). This is an important field: it allows you to broadcast all the information you want for each user (a username, for example) | | `data` | string | Data associated to this connection (and therefore to certain user). This is an important field: it allows you to broadcast all the information you want for each user (a username, for example) |
| `creationTime` | number | Time when this connection was created | | `creationTime` | number | Time when this connection was created |
## openvidu-backend-client ## openvidu-backend-client
@ -481,6 +481,7 @@ ng serve
``` ```
**/openvidu** **/openvidu**
``` ```
mvn compile -DskipTests=true
mvn install -DskipTests=true mvn install -DskipTests=true
``` ```
**/openvidu/openvidu-server** **/openvidu/openvidu-server**

View File

@ -1,4 +1,3 @@
// Participant --------------------------------
import { Stream, StreamOptions } from './Stream'; import { Stream, StreamOptions } from './Stream';
import { OpenViduInternal } from './OpenViduInternal'; import { OpenViduInternal } from './OpenViduInternal';
import { SessionInternal } from './SessionInternal'; import { SessionInternal } from './SessionInternal';

View File

@ -23,18 +23,19 @@ package org.openvidu.server.core.api.pojo;
* *
*/ */
public class UserParticipant { public class UserParticipant {
private String participantId; private String participantId;
private String userName; private String userName;
private String clientMetadata; private String clientMetadata = "";
private String serverMetadata; private String serverMetadata = "";
private boolean streaming = false; private boolean streaming = false;
private final String METADATA_SEPARATOR = "%/%";
public UserParticipant(String participantId, String userName, boolean streaming) { public UserParticipant(String participantId, String userName, boolean streaming) {
super(); super();
this.participantId = participantId; this.participantId = participantId;
this.userName = userName; this.userName = userName;
this.clientMetadata = "";
this.serverMetadata = "";
this.streaming = streaming; this.streaming = streaming;
} }
@ -94,7 +95,14 @@ public class UserParticipant {
} }
public String getFullMetadata(){ public String getFullMetadata(){
return this.clientMetadata + "-/-" + this.serverMetadata; String fullMetadata;
if ((!this.clientMetadata.isEmpty()) && (!this.serverMetadata.isEmpty())){
fullMetadata = this.clientMetadata + METADATA_SEPARATOR + this.serverMetadata;
}
else {
fullMetadata = this.clientMetadata + this.serverMetadata;
}
return fullMetadata;
} }
@Override @Override

View File

@ -71,7 +71,7 @@ public class DefaultNotificationRoomHandler implements NotificationRoomHandler {
// Metadata associated to each existing participant // Metadata associated to each existing participant
participantJson participantJson
.addProperty(ProtocolElements.JOINROOM_METADATA_PARAM, participant.getClientMetadata() + "--" + participant.getServerMetadata()); .addProperty(ProtocolElements.JOINROOM_METADATA_PARAM, participant.getFullMetadata());
if (participant.isStreaming()) { if (participant.isStreaming()) {
JsonObject stream = new JsonObject(); JsonObject stream = new JsonObject();

View File

@ -4,8 +4,8 @@ public class Token {
String token; String token;
ParticipantRole role; ParticipantRole role;
String serverMetadata; String serverMetadata = "";
String clientMetadata ; String clientMetadata = "";
public Token(String token) { public Token(String token) {
this.token = token; this.token = token;