completionHandler
parameter:
- OT.initPublisher()
- OT.reportIssue()
- OT.setProxyUrl()
- Publisher.setVideoSource()
- Session.connect()
- Session.forceDisconnect()
- Session.forceUnpublish()
- Session.publish()
- Session.subscribe()
- Subscriber.getStats()
The Error class also defines the Error thrown when the promise returned by one of the following methods is rejected:
- OT.unblockAudio()
- Publisher.applyVideoFilter()
- Publisher.clearVideoFilter()
- Publisher.applyAudioFilter()
- Publisher.clearAudioFilter()
- Publisher.getRtcStatsReport()
- Session.forceMuteAll()
- Session.forceMuteStream()
- Session.setEncryptionSecret()
- Subscriber.getRtcStatsReport()
The
completionHandler
parameter is a function that is called when the call to the
asynchronous method succeeds or fails. If the asynchronous call
fails, the completion handler function is passed an error object
(defined by the Error class). The
code
and
message
properties of the error object provide details about the error.
Deprecation notice:
OT.Error
will not be defined in an upcoming version of OpenTok. When this
happens, errors emitted by the SDK will simply be instances of
standard
Error
objects. If your code currently checks
if (error instanceof OT.Error)
please replace it
if (/^OT_/.test(error.name))
. (The
name
property for all OpenTok errors with begins with
'OT_'
.) Note however that this code is for the purposes of smoothly
upgrading, and it may be more appropriate for your code to
simply compare against the specific error you want to handle,
such as
if (error.name === 'OT_USER_MEDIA_ACCESS_DENIED')
.
Properties
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
code |
Number |
Deprecated — the error code. Use the
name
property, not the
code
property, to identify the error programatically.
The
Errors when calling
Errors after calling
Errors when calling
Errors when calling
Errors when calling
Errors when calling
Errors when calling
Errors when calling
Errors when calling
Errors when calling
Errors when calling
General errors that can occur when calling any method:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
message |
String |
The message string provides details about the error.
Use the
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name |
String |
A string identifying the error. Use this property (not the
code
property) to identify the error.
Note that for all errors, this string starts with
The
Errors that can occur when calling
Errors that can occur when calling
Errors that can occur when calling the
Errors that can occur when calling
Errors that can occur when calling
Errors that can occur when calling
Errors that can occur when calling
Errors that can occur when calling
Errors that can occur when calling
Errors that can occur when calling
Errors that can occur when calling
Errors that can occur when calling
Errors that can occur when calling
Errors that can occur when the Promise returned by the
Errors that can occur when the Promise returned by the
|
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}
preventDefault()
(
true
) or not (
false
). See
preventDefault()
.
Returns:
preventDefault ()
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 .