2018-06-01 14:39:38 +02:00
|
|
|
import { StreamManager } from '../../OpenVidu/StreamManager';
|
2018-05-08 13:01:34 +02:00
|
|
|
import { Session } from '../../OpenVidu/Session';
|
2018-04-26 15:33:47 +02:00
|
|
|
export declare abstract class Event {
|
|
|
|
/**
|
2018-07-11 11:47:53 +02:00
|
|
|
* Whether the event has a default behavior that may be prevented by calling [[Event.preventDefault]]
|
2018-04-26 15:33:47 +02:00
|
|
|
*/
|
|
|
|
cancelable: boolean;
|
|
|
|
/**
|
|
|
|
* The object that dispatched the event
|
|
|
|
*/
|
2018-06-01 14:39:38 +02:00
|
|
|
target: Session | StreamManager;
|
2018-04-26 15:33:47 +02:00
|
|
|
/**
|
|
|
|
* The type of event. This is the same string you pass as first parameter when calling method `on()` of any object implementing [[EventDispatcher]] interface
|
|
|
|
*/
|
|
|
|
type: string;
|
|
|
|
private hasBeenPrevented;
|
|
|
|
/**
|
|
|
|
* @hidden
|
|
|
|
*/
|
2018-06-01 14:39:38 +02:00
|
|
|
constructor(cancelable: boolean, target: Session | StreamManager, type: string);
|
2018-04-26 15:33:47 +02:00
|
|
|
/**
|
|
|
|
* Whether the default beahivour of the event has been prevented or not. Call [[Event.preventDefault]] to prevent it
|
|
|
|
*/
|
|
|
|
isDefaultPrevented(): boolean;
|
|
|
|
/**
|
2018-07-11 11:47:53 +02:00
|
|
|
* Prevents the default behavior of the event. The following events have a default behavior:
|
2018-06-01 14:39:38 +02:00
|
|
|
*
|
|
|
|
* - `sessionDisconnected`: dispatched by [[Session]] object, automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
|
|
|
|
* and also deletes any HTML video element associated to each Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as `targetElement` in method [[Session.subscribe]] or
|
|
|
|
* by calling [[Subscriber.createVideoElement]]). For every video removed, each Subscriber object will also dispatch a `videoElementDestroyed` event.
|
|
|
|
*
|
|
|
|
* - `streamDestroyed`:
|
|
|
|
* - If dispatched by a [[Publisher]] (*you* have unpublished): automatically stops all media tracks and deletes any HTML video element associated to it (only those created by OpenVidu Browser, either by passing a valid parameter as `targetElement`
|
|
|
|
* in method [[OpenVidu.initPublisher]] or by calling [[Publisher.createVideoElement]]). For every video removed, the Publisher object will also dispatch a `videoElementDestroyed` event.
|
|
|
|
* - If dispatched by [[Session]] (*other user* has unpublished): automatically unsubscribes the proper Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
|
|
|
|
* and also deletes any HTML video element associated to that Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as `targetElement` in method [[Session.subscribe]] or
|
|
|
|
* by calling [[Subscriber.createVideoElement]]). For every video removed, the Subscriber object will also dispatch a `videoElementDestroyed` event.
|
2018-04-26 15:33:47 +02:00
|
|
|
*/
|
|
|
|
preventDefault(): void;
|
2018-07-11 11:47:53 +02:00
|
|
|
protected abstract callDefaultBehavior(): any;
|
2018-04-26 15:33:47 +02:00
|
|
|
}
|