openvidu-browser 'streamCreated' event removed from Publisher

pull/20/head
pabloFuente 2017-10-02 15:17:47 +02:00
parent bfe8e61738
commit a21ecc2c3a
6 changed files with 1561 additions and 2748 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -115,16 +115,6 @@ export class Publisher {
});
}
}
if (eventName == 'streamCreated') {
if (this.stream.isReady) {
this.ee.emitEvent('streamCreated', [{ stream: this.stream }]);
} else {
this.stream.addEventListener('stream-created-by-publisher', () => {
console.warn('Publisher emitting streamCreated');
this.ee.emitEvent('streamCreated', [{ stream: this.stream }]);
});
}
}
if (eventName == 'accessAllowed') {
if (this.stream.accessIsAllowed) {
this.ee.emitEvent('accessAllowed');

View File

@ -161,7 +161,6 @@ export class SessionInternal {
// Adding the remote stream to the OpenVidu object
this.openVidu.getRemoteStreams().push(stream);
}
//}
callback(undefined);
}
@ -252,13 +251,12 @@ export class SessionInternal {
onParticipantPublished(options) {
options.metadata = this.participants[options.id].data;
// Get the existing Connection created on 'onParticipantJoined' for
// existing participants or create a new one for new participants
let connection = this.participants[options.id];
if (connection) {
// Update existing Connection
options.metadata = connection.data;
connection.options = options;
connection.initStreams(options);
} else {
@ -273,7 +271,7 @@ export class SessionInternal {
console.debug("Remote Connection found in connections list by its id [" + pid + "]");
}
connection.creationTime = this.participants[pid].creationTime;
this.participants[pid] = connection;
this.ee.emitEvent('participant-published', [{ connection }]);

View File

@ -295,8 +295,6 @@ export class Stream {
this.video = parentElement.appendChild(this.video);
}
this.ee.emitEvent('stream-created-by-publisher');
this.isReady = true;
return this.video;