- new MediaError(value)
- Members
- static, constant defaultMessages :Array
- static, readonly errorTypes :array
- static, constant MEDIA_ERR_ABORTED :number
- static, constant MEDIA_ERR_CUSTOM :number
- static, constant MEDIA_ERR_DECODE :number
- static, constant MEDIA_ERR_ENCRYPTED :number
- static, constant MEDIA_ERR_NETWORK :number
- static, constant MEDIA_ERR_SRC_NOT_SUPPORTED :number
- code :Number
- constant MEDIA_ERR_ABORTED :number
- constant MEDIA_ERR_CUSTOM :number
- constant MEDIA_ERR_DECODE :number
- constant MEDIA_ERR_ENCRYPTED :number
- constant MEDIA_ERR_NETWORK :number
- constant MEDIA_ERR_SRC_NOT_SUPPORTED :number
- message :String
- status :Array
new MediaError(value)
[media-error.js](https://docs.videojs.com/media-error.js.html)
, [line 6](https://docs.videojs.com/media-error.js.html#line6)
A Custom MediaError
class which mimics the standard HTML5 MediaError
class.
Parameters:
Name | Type | Description |
---|---|---|
value | number | string | Object | MediaError | This can be of multiple types: - number: should be a standard error code - string: an error message (the code will be 0) - Object: arbitrary properties - |
See:
Members
static, constant defaultMessages :Array
[media-error.js](https://docs.videojs.com/media-error.js.html)
, [line 106](https://docs.videojs.com/media-error.js.html#line106)
The default MediaError
messages based on the MediaError.errorTypes.
static, readonly errorTypes :array
[media-error.js](https://docs.videojs.com/media-error.js.html)
, [line 91](https://docs.videojs.com/media-error.js.html#line91)
Errors indexed by the W3C standard. The order CANNOT CHANGE! See the specification listed under MediaError for more information.
Properties:
Name | Type | Description |
---|---|---|
0 | string | MEDIA_ERR_CUSTOM |
1 | string | MEDIA_ERR_ABORTED |
2 | string | MEDIA_ERR_NETWORK |
3 | string | MEDIA_ERR_DECODE |
4 | string | MEDIA_ERR_SRC_NOT_SUPPORTED |
5 | string | MEDIA_ERR_ENCRYPTED |
static, constant MEDIA_ERR_ABORTED :number
[media-error.js](https://docs.videojs.com/media-error.js.html)
, [line 146](https://docs.videojs.com/media-error.js.html#line146)
W3C error code for media error aborted.
Default Value:
- 1
static, constant MEDIA_ERR_CUSTOM :number
[media-error.js](https://docs.videojs.com/media-error.js.html)
, [line 131](https://docs.videojs.com/media-error.js.html#line131)
W3C error code for any custom error.
Default Value:
- 0
static, constant MEDIA_ERR_DECODE :number
[media-error.js](https://docs.videojs.com/media-error.js.html)
, [line 176](https://docs.videojs.com/media-error.js.html#line176)
W3C error code for any decoding error.
Default Value:
- 3
static, constant MEDIA_ERR_ENCRYPTED :number
[media-error.js](https://docs.videojs.com/media-error.js.html)
, [line 206](https://docs.videojs.com/media-error.js.html#line206)
W3C error code for any time that a source is encrypted.
Default Value:
- 5
static, constant MEDIA_ERR_NETWORK :number
[media-error.js](https://docs.videojs.com/media-error.js.html)
, [line 161](https://docs.videojs.com/media-error.js.html#line161)
W3C error code for any network error.
Default Value:
- 2
static, constant MEDIA_ERR_SRC_NOT_SUPPORTED :number
[media-error.js](https://docs.videojs.com/media-error.js.html)
, [line 191](https://docs.videojs.com/media-error.js.html#line191)
W3C error code for any time that a source is not supported.
Default Value:
- 4
code :Number
[media-error.js](https://docs.videojs.com/media-error.js.html)
, [line 57](https://docs.videojs.com/media-error.js.html#line57)
The error code that refers two one of the defined MediaError
types
constant MEDIA_ERR_ABORTED :number
[media-error.js](https://docs.videojs.com/media-error.js.html)
, [line 139](https://docs.videojs.com/media-error.js.html#line139)
W3C error code for media error aborted.
Default Value:
- 1
constant MEDIA_ERR_CUSTOM :number
[media-error.js](https://docs.videojs.com/media-error.js.html)
, [line 124](https://docs.videojs.com/media-error.js.html#line124)
W3C error code for any custom error.
Default Value:
- 0
constant MEDIA_ERR_DECODE :number
[media-error.js](https://docs.videojs.com/media-error.js.html)
, [line 169](https://docs.videojs.com/media-error.js.html#line169)
W3C error code for any decoding error.
Default Value:
- 3
constant MEDIA_ERR_ENCRYPTED :number
[media-error.js](https://docs.videojs.com/media-error.js.html)
, [line 199](https://docs.videojs.com/media-error.js.html#line199)
W3C error code for any time that a source is encrypted.
Default Value:
- 5
constant MEDIA_ERR_NETWORK :number
[media-error.js](https://docs.videojs.com/media-error.js.html)
, [line 154](https://docs.videojs.com/media-error.js.html#line154)
W3C error code for any network error.
Default Value:
- 2
constant MEDIA_ERR_SRC_NOT_SUPPORTED :number
[media-error.js](https://docs.videojs.com/media-error.js.html)
, [line 184](https://docs.videojs.com/media-error.js.html#line184)
W3C error code for any time that a source is not supported.
Default Value:
- 4
message :String
[media-error.js](https://docs.videojs.com/media-error.js.html)
, [line 65](https://docs.videojs.com/media-error.js.html#line65)
An optional message that to show with the error. Message is not part of the HTML5 video spec but allows for more informative custom errors.
status :Array
[media-error.js](https://docs.videojs.com/media-error.js.html)
, [line 76](https://docs.videojs.com/media-error.js.html#line76)
An optional status code that can be set by plugins to allow even more detail about the error. For example a plugin might provide a specific HTTP status code and an error message for that code. Then when the plugin gets that error this class will know how to display an error message for it. This allows a custom message to show up on the Player
error overlay.