Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SignalEvent

Defines the following events:

  • signal: dispatched by Session when a signal is received
  • signal:TYPE: dispatched by Session when a signal of type TYPE is received

Hierarchy

Index

Properties

cancelable

cancelable: boolean

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

Optional data

data: undefined | string

The message of the signal (can be empty)

Optional from

The client that sent the signal. This property is undefined if the signal was directly generated by the application server (not by other client)

target

The object that dispatched the event

type

type: string

The type of signal. It is string "signal" for those signals sent with no SignalOptions.type property, and "signal:type" if was sent with a valid SignalOptions.type property.

The client must be specifically subscribed to Session.on('signal:type', function(signalEvent) {...}) to trigger that type of signal.

Subscribing to Session.on('signal', function(signalEvent) {...}) will trigger all signals, no matter their type.

Methods

isDefaultPrevented

  • isDefaultPrevented(): boolean

preventDefault

  • preventDefault(): void
  • Prevents the default behavior of the event. The following events have a default behavior:

    • 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