From 4219c6dbc75c5704ee34aee134e6a4e1befc214f Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Mon, 22 Mar 2021 13:27:58 +0100 Subject: [PATCH] openvidu-browser: Stream is not a public EventDispatcher --- openvidu-browser/src/OpenVidu/Stream.ts | 40 ++++++------------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/openvidu-browser/src/OpenVidu/Stream.ts b/openvidu-browser/src/OpenVidu/Stream.ts index b82e9b61..6ee5c5f7 100644 --- a/openvidu-browser/src/OpenVidu/Stream.ts +++ b/openvidu-browser/src/OpenVidu/Stream.ts @@ -16,12 +16,10 @@ */ import { Connection } from './Connection'; -import { Event } from '../OpenViduInternal/Events/Event'; import { Filter } from './Filter'; import { Session } from './Session'; import { StreamManager } from './StreamManager'; import { Subscriber } from './Subscriber'; -import { EventDispatcher } from './EventDispatcher'; import { InboundStreamOptions } from '../OpenViduInternal/Interfaces/Private/InboundStreamOptions'; import { OutboundStreamOptions } from '../OpenViduInternal/Interfaces/Private/OutboundStreamOptions'; import { WebRtcPeer, WebRtcPeerSendonly, WebRtcPeerRecvonly, WebRtcPeerSendrecv } from '../OpenViduInternal/WebRtcPeer/WebRtcPeer'; @@ -37,6 +35,10 @@ import { PlatformUtils } from '../OpenViduInternal/Utils/Platform'; * @hidden */ import hark = require('hark'); +/** + * @hidden + */ +import EventEmitter = require('wolfy87-eventemitter'); /** * @hidden */ @@ -52,7 +54,7 @@ let platform: PlatformUtils; * Each [[Publisher]] and [[Subscriber]] has an attribute of type Stream, as they give access * to one of them (sending and receiving it, respectively) */ -export class Stream extends EventDispatcher { +export class Stream { /** * The Connection object that is publishing the stream @@ -207,6 +209,10 @@ export class Stream extends EventDispatcher { * @hidden */ localMediaStreamWhenSubscribedToRemote?: MediaStream; + /** + * @hidden + */ + ee = new EventEmitter(); /** @@ -214,7 +220,6 @@ export class Stream extends EventDispatcher { */ constructor(session: Session, options: InboundStreamOptions | OutboundStreamOptions | {}) { - super(); platform = PlatformUtils.getInstance(); this.session = session; @@ -271,33 +276,6 @@ export class Stream extends EventDispatcher { } - /** - * See [[EventDispatcher.on]] - */ - on(type: string, handler: (event: Event) => void): EventDispatcher { - super.onAux(type, "Event '" + type + "' triggered by stream '" + this.streamId + "'", handler); - return this; - } - - - /** - * See [[EventDispatcher.once]] - */ - once(type: string, handler: (event: Event) => void): EventDispatcher { - super.onceAux(type, "Event '" + type + "' triggered once by stream '" + this.streamId + "'", handler); - return this; - } - - - /** - * See [[EventDispatcher.off]] - */ - off(type: string, handler?: (event: Event) => void): EventDispatcher { - super.off(type, handler); - return this; - } - - /** * Applies an audio/video filter to the stream. *