Class MediaError
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The MediaError interface represents an error which occurred while handling media in an HTML media element based on HTMLMediaElement, such as {{HTMLElement("audio")}} or {{HTMLElement("video")}}.
[Value("MediaError")]
public class MediaError
- Inheritance
-
MediaError
- Inherited Members
Remarks
A MediaError object describes the error in general terms using a numeric code categorizing the kind of error, and a message, which provides specific diagnostics about what went wrong.
Constructors
MediaError()
public MediaError()
Fields
MEDIA_ERR_ABORTED
[Value("MEDIA_ERR_ABORTED")]
public const ushort MEDIA_ERR_ABORTED = 1
Field Value
MEDIA_ERR_DECODE
[Value("MEDIA_ERR_DECODE")]
public const ushort MEDIA_ERR_DECODE = 3
Field Value
MEDIA_ERR_NETWORK
[Value("MEDIA_ERR_NETWORK")]
public const ushort MEDIA_ERR_NETWORK = 2
Field Value
MEDIA_ERR_SRC_NOT_SUPPORTED
[Value("MEDIA_ERR_SRC_NOT_SUPPORTED")]
public const ushort MEDIA_ERR_SRC_NOT_SUPPORTED = 4
Field Value
Properties
Code
The read-only property MediaError.code returns a numeric
value which represents the kind of error that occurred on a media element. To get a text
string with specific diagnostic information, see Message.
[Value("code")]
public ushort Code { get; }
Property Value
- ushort
A numeric value indicating the general type of error which occurred. The possible
values are described below, in Media error code constants.
Remarks
-MediaError: Interface used to define the MediaError.code property
Message
The read-only property MediaError.message returns a human-readable string offering specific diagnostic details related to the error described by the MediaError object, or an empty string ("") if no diagnostic information can be determined or provided.
[Value("message")]
public string Message { get; }
Property Value
- string
A string providing a detailed, specific explanation of what went wrong and possibly how it might be fixed. This is not a generic description of the Code property's value, but instead goes deeper into the specifics of this particular error and its circumstances.
If no specific details are available, this string is empty.
Remarks
-MediaError: Interface used to define the MediaError.message property
-audio, video