VideoEnabledChangedEvent
Defines the event object for the videoDisabled and videoEnabled
events dispatched by the Subscriber.
Properties
cancelable
Type: Boolean
Whether the event has a default behavior that is cancelable
(true) or not (false). You can cancel the default behavior by
calling the preventDefault() method of the event object in the callback
function. (See preventDefault().)
reason
Type: String
The reason the video was disabled or enabled. This can be set to one of the following values:
-
"publishVideo"— The publisher started or stopped publishing video, by callingpublishVideo(true)orpublishVideo(false). -
"quality"— The sending of video can be started or stopped based on stream quality changes. When subscriber audio-fallback is enabled, the Vonage Video API Media Router starts or stops sending video to the subscriber based on stream quality changes. This feature of the Vonage Video API Media Router has a subscriber drop the video stream when connectivity degrades. (The subscriber continues to receive the audio stream, if there is one.) If connectivity improves to support video again, the Subscriber object dispatches avideoEnabledevent, and the Subscriber resumes receiving video. By default, the Subscriber displays a video disabled indicator when avideoDisabledevent with this reason is dispatched and removes the indicator when thevideoEnabledevent with this reason is dispatched. You can control the display of this icon by calling thesetStyle()method of the Subscriber, setting thevideoDisabledDisplayModeproperty(or you can set the style when calling theSession.subscribe()method, setting thestyleproperty of thepropertiesparameter). This feature is only available in sessions that use the Vonage Video API Media Router (sessions with the media mode set to routed), not in sessions with the media mode set to relayed. -
When publisher audio-fallback is enabled, the Publisher starts or stops sending video based on stream quality changes. (The subscriber continues to receive the audio stream, if there is one.) If connectivity improves to support video again, the Publisher object dispatches a
videoEnabledevent, and the Subscriber resumes receiving video. By default, the Publisher displays a video disabled indicator when avideoDisabledevent with this reason is dispatched and removes the indicator when thevideoEnabledevent with this reason is dispatched. You can control the display of this icon by calling thesetStyle()method of the Publisher and setting thevideoDisabledDisplayModeproperty, or you can set thevideoDisabledDisplayModeproperty when calling theOT.initPublisher()method and setting thestyleproperty of thepropertiesparameter. -
"subscribeToVideo"— The subscriber started or stopped subscribing to video, by callingsubscribeToVideo(true)orsubscribeToVideo(false). -
"codecNotSupported"— The subscriber stopped subscribing to video due to an incompatible codec. -
"codecChanged"— The subscriber video was enabled after a codec change from an incompatible codec. -
"serverRotation"— The Publishing client was disconnected from the session because of Video API server rotation.
target
Type: Object
The object that dispatched the event.
type
Type: String
The type of event: "videoDisabled" or
"videoEnabled".
Methods
| Name | Description |
|---|---|
isDefaultPrevented() → {Boolean} |
Whether the default event behavior has been prevented via a call to preventDefault() (true) or not (false). |
preventDefault() |
Prevents the default behavior associated with the event from taking place. |
isDefaultPrevented() → {Boolean}
Whether the default event behavior has been prevented via a call to
preventDefault() (true) or not (false).
See preventDefault().
Returns:
preventDefault()
Prevents the default behavior associated with the event from taking place.
To see whether an event has a default behavior, check the cancelable property
of the event object.
Call the preventDefault() method in the callback function for the event.
The following events have default behaviors:
sessionDisconnect— See SessionDisconnectEvent.preventDefault().streamDestroyed— See StreamEvent.preventDefault().accessDialogOpened— See the accessDialogOpened event.accessDenied— See the accessDenied event.