diff --git a/openvidu-browser/src/main/resources/ts/OpenVidu/Publisher.ts b/openvidu-browser/src/main/resources/ts/OpenVidu/Publisher.ts index 5a57b3ba..da07d677 100644 --- a/openvidu-browser/src/main/resources/ts/OpenVidu/Publisher.ts +++ b/openvidu-browser/src/main/resources/ts/OpenVidu/Publisher.ts @@ -57,7 +57,7 @@ export class Publisher { callback(event); }); if (eventName == 'videoElementCreated') { - if (this.stream.isReady) { + if (this.stream.isVideoELementCreated) { this.ee.emitEvent('videoElementCreated', [{ element: this.stream.getVideoElement() }]); @@ -66,7 +66,7 @@ export class Publisher { console.warn('Publisher emitting videoElementCreated'); this.id = element.id; this.ee.emitEvent('videoElementCreated', [{ - element: element + element: element.element }]); }); } diff --git a/openvidu-browser/src/main/resources/ts/OpenViduInternal/Stream.ts b/openvidu-browser/src/main/resources/ts/OpenViduInternal/Stream.ts index 0a1d036f..39eaade9 100644 --- a/openvidu-browser/src/main/resources/ts/OpenViduInternal/Stream.ts +++ b/openvidu-browser/src/main/resources/ts/OpenViduInternal/Stream.ts @@ -73,6 +73,7 @@ export class Stream { private videoSrc: string; private parentId: string; public isReady: boolean = false; + public isVideoELementCreated: boolean = false; public accessIsAllowed: boolean = false; public accessIsDenied: boolean = false; @@ -246,7 +247,7 @@ export class Stream { playOnlyVideo(parentElement, thumbnailId) { // TO-DO: check somehow if the stream is audio only, so the element created is