forked from video-dev/hls.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request video-dev#2292 from video-dev/typescript-errors
convert errors to typescript
- Loading branch information
Showing
1 changed file
with
37 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,72 @@ | ||
export const ErrorTypes = { | ||
export enum ErrorTypes { | ||
// Identifier for a network error (loading error / timeout ...) | ||
NETWORK_ERROR: 'networkError', | ||
NETWORK_ERROR = 'networkError', | ||
// Identifier for a media Error (video/parsing/mediasource error) | ||
MEDIA_ERROR: 'mediaError', | ||
MEDIA_ERROR = 'mediaError', | ||
// EME (encrypted media extensions) errors | ||
KEY_SYSTEM_ERROR: 'keySystemError', | ||
KEY_SYSTEM_ERROR = 'keySystemError', | ||
// Identifier for a mux Error (demuxing/remuxing) | ||
MUX_ERROR: 'muxError', | ||
MUX_ERROR = 'muxError', | ||
// Identifier for all other errors | ||
OTHER_ERROR: 'otherError' | ||
}; | ||
OTHER_ERROR = 'otherError' | ||
} | ||
|
||
/** | ||
* @enum {ErrorDetails} | ||
* @typedef {string} ErrorDetail | ||
*/ | ||
export const ErrorDetails = { | ||
KEY_SYSTEM_NO_KEYS: 'keySystemNoKeys', | ||
KEY_SYSTEM_NO_ACCESS: 'keySystemNoAccess', | ||
KEY_SYSTEM_NO_SESSION: 'keySystemNoSession', | ||
KEY_SYSTEM_LICENSE_REQUEST_FAILED: 'keySystemLicenseRequestFailed', | ||
export enum ErrorDetails { | ||
KEY_SYSTEM_NO_KEYS = 'keySystemNoKeys', | ||
KEY_SYSTEM_NO_ACCESS = 'keySystemNoAccess', | ||
KEY_SYSTEM_NO_SESSION = 'keySystemNoSession', | ||
KEY_SYSTEM_LICENSE_REQUEST_FAILED = 'keySystemLicenseRequestFailed', | ||
// Identifier for a manifest load error - data: { url : faulty URL, response : { code: error code, text: error text }} | ||
MANIFEST_LOAD_ERROR: 'manifestLoadError', | ||
MANIFEST_LOAD_ERROR = 'manifestLoadError', | ||
// Identifier for a manifest load timeout - data: { url : faulty URL, response : { code: error code, text: error text }} | ||
MANIFEST_LOAD_TIMEOUT: 'manifestLoadTimeOut', | ||
MANIFEST_LOAD_TIMEOUT = 'manifestLoadTimeOut', | ||
// Identifier for a manifest parsing error - data: { url : faulty URL, reason : error reason} | ||
MANIFEST_PARSING_ERROR: 'manifestParsingError', | ||
MANIFEST_PARSING_ERROR = 'manifestParsingError', | ||
// Identifier for a manifest with only incompatible codecs error - data: { url : faulty URL, reason : error reason} | ||
MANIFEST_INCOMPATIBLE_CODECS_ERROR: 'manifestIncompatibleCodecsError', | ||
MANIFEST_INCOMPATIBLE_CODECS_ERROR = 'manifestIncompatibleCodecsError', | ||
// Identifier for a level load error - data: { url : faulty URL, response : { code: error code, text: error text }} | ||
LEVEL_LOAD_ERROR: 'levelLoadError', | ||
LEVEL_LOAD_ERROR = 'levelLoadError', | ||
// Identifier for a level load timeout - data: { url : faulty URL, response : { code: error code, text: error text }} | ||
LEVEL_LOAD_TIMEOUT: 'levelLoadTimeOut', | ||
LEVEL_LOAD_TIMEOUT = 'levelLoadTimeOut', | ||
// Identifier for a level switch error - data: { level : faulty level Id, event : error description} | ||
LEVEL_SWITCH_ERROR: 'levelSwitchError', | ||
LEVEL_SWITCH_ERROR = 'levelSwitchError', | ||
// Identifier for an audio track load error - data: { url : faulty URL, response : { code: error code, text: error text }} | ||
AUDIO_TRACK_LOAD_ERROR: 'audioTrackLoadError', | ||
AUDIO_TRACK_LOAD_ERROR = 'audioTrackLoadError', | ||
// Identifier for an audio track load timeout - data: { url : faulty URL, response : { code: error code, text: error text }} | ||
AUDIO_TRACK_LOAD_TIMEOUT: 'audioTrackLoadTimeOut', | ||
AUDIO_TRACK_LOAD_TIMEOUT = 'audioTrackLoadTimeOut', | ||
// Identifier for fragment load error - data: { frag : fragment object, response : { code: error code, text: error text }} | ||
FRAG_LOAD_ERROR: 'fragLoadError', | ||
FRAG_LOAD_ERROR = 'fragLoadError', | ||
// Identifier for fragment load timeout error - data: { frag : fragment object} | ||
FRAG_LOAD_TIMEOUT: 'fragLoadTimeOut', | ||
FRAG_LOAD_TIMEOUT = 'fragLoadTimeOut', | ||
// Identifier for a fragment decryption error event - data: {id : demuxer Id,frag: fragment object, reason : parsing error description } | ||
FRAG_DECRYPT_ERROR: 'fragDecryptError', | ||
FRAG_DECRYPT_ERROR = 'fragDecryptError', | ||
// Identifier for a fragment parsing error event - data: { id : demuxer Id, reason : parsing error description } | ||
// will be renamed DEMUX_PARSING_ERROR and switched to MUX_ERROR in the next major release | ||
FRAG_PARSING_ERROR: 'fragParsingError', | ||
FRAG_PARSING_ERROR = 'fragParsingError', | ||
// Identifier for a remux alloc error event - data: { id : demuxer Id, frag : fragment object, bytes : nb of bytes on which allocation failed , reason : error text } | ||
REMUX_ALLOC_ERROR: 'remuxAllocError', | ||
REMUX_ALLOC_ERROR = 'remuxAllocError', | ||
// Identifier for decrypt key load error - data: { frag : fragment object, response : { code: error code, text: error text }} | ||
KEY_LOAD_ERROR: 'keyLoadError', | ||
KEY_LOAD_ERROR = 'keyLoadError', | ||
// Identifier for decrypt key load timeout error - data: { frag : fragment object} | ||
KEY_LOAD_TIMEOUT: 'keyLoadTimeOut', | ||
KEY_LOAD_TIMEOUT = 'keyLoadTimeOut', | ||
// Triggered when an exception occurs while adding a sourceBuffer to MediaSource - data : { err : exception , mimeType : mimeType } | ||
BUFFER_ADD_CODEC_ERROR: 'bufferAddCodecError', | ||
BUFFER_ADD_CODEC_ERROR = 'bufferAddCodecError', | ||
// Identifier for a buffer append error - data: append error description | ||
BUFFER_APPEND_ERROR: 'bufferAppendError', | ||
BUFFER_APPEND_ERROR = 'bufferAppendError', | ||
// Identifier for a buffer appending error event - data: appending error description | ||
BUFFER_APPENDING_ERROR: 'bufferAppendingError', | ||
BUFFER_APPENDING_ERROR = 'bufferAppendingError', | ||
// Identifier for a buffer stalled error event | ||
BUFFER_STALLED_ERROR: 'bufferStalledError', | ||
BUFFER_STALLED_ERROR = 'bufferStalledError', | ||
// Identifier for a buffer full event | ||
BUFFER_FULL_ERROR: 'bufferFullError', | ||
BUFFER_FULL_ERROR = 'bufferFullError', | ||
// Identifier for a buffer seek over hole event | ||
BUFFER_SEEK_OVER_HOLE: 'bufferSeekOverHole', | ||
BUFFER_SEEK_OVER_HOLE = 'bufferSeekOverHole', | ||
// Identifier for a buffer nudge on stall (playback is stuck although currentTime is in a buffered area) | ||
BUFFER_NUDGE_ON_STALL: 'bufferNudgeOnStall', | ||
BUFFER_NUDGE_ON_STALL = 'bufferNudgeOnStall', | ||
// Identifier for an internal exception happening inside hls.js while handling an event | ||
INTERNAL_EXCEPTION: 'internalException' | ||
}; | ||
INTERNAL_EXCEPTION = 'internalException' | ||
} |