Defines the following events:

- `connectionCreated`: dispatched by Session
- `connectionDestroyed`: dispatched by Session

### Hierarchy

- Event
  - ConnectionEvent

## Index

### Properties

- cancelable
- connection
- reason
- target
- type

### Methods

- isDefaultPrevented
- preventDefault

## Properties

### cancelable

cancelable: boolean

Inherited from Event.cancelable

- Defined in OpenViduInternal/Events/Event.ts:26

Whether the event has a default behaviour that may be prevented by calling Event.preventDefault

### connection

connection: Connection

- Defined in OpenViduInternal/Events/ConnectionEvent.ts:33

Connection object that was created or destroyed

### reason

reason: string

- Defined in OpenViduInternal/Events/ConnectionEvent.ts:42

For 'connectionDestroyed' event:

- "disconnect": the remote user has called `Session.disconnect()`
- "networkDisconnect": the remote user network connection has dropped

For 'connectionCreated' empty string

### target

target: Session | StreamManager

Inherited from Event.target

- Defined in OpenViduInternal/Events/Event.ts:31

The object that dispatched the event

### type

type: string

Inherited from Event.type

- Defined in OpenViduInternal/Events/Event.ts:36

The type of event. This is the same string you pass as first parameter when calling method `on()` of any object implementing EventDispatcher interface

## Methods

### isDefaultPrevented

- isDefaultPrevented(): boolean

- Inherited from Event.isDefaultPrevented

  - Defined in OpenViduInternal/Events/Event.ts:52

  Whether the default beahivour of the event has been prevented or not. Call Event.preventDefault to prevent it

  #### Returns boolean

### preventDefault

- preventDefault(): void

- Inherited from Event.preventDefault

  - Defined in OpenViduInternal/Events/Event.ts:70

  Prevents the default behaviour of the event. The following events have a default behaviour:

  - `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.

  #### Returns void

Generated using TypeDoc