mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add enum for media errors
This commit is contained in:
parent
94c5b586db
commit
081d408b18
5 changed files with 52 additions and 26 deletions
|
@ -5,6 +5,7 @@ import profileBuilder from '../../scripts/browserDeviceProfile';
|
|||
import { getIncludeCorsCredentials } from '../../scripts/settings/webSettings';
|
||||
import { PluginType } from '../../types/plugin.ts';
|
||||
import Events from '../../utils/events.ts';
|
||||
import { MediaError } from 'types/mediaError';
|
||||
|
||||
function getDefaultProfile() {
|
||||
return profileBuilder({});
|
||||
|
@ -343,7 +344,7 @@ class HtmlAudioPlayer {
|
|||
return;
|
||||
case 2:
|
||||
// MEDIA_ERR_NETWORK
|
||||
type = 'network';
|
||||
type = MediaError.NETWORK_ERROR;
|
||||
break;
|
||||
case 3:
|
||||
// MEDIA_ERR_DECODE
|
||||
|
@ -351,12 +352,12 @@ class HtmlAudioPlayer {
|
|||
htmlMediaHelper.handleHlsJsMediaError(self);
|
||||
return;
|
||||
} else {
|
||||
type = 'mediadecodeerror';
|
||||
type = MediaError.MEDIA_DECODE_ERROR;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
// MEDIA_ERR_SRC_NOT_SUPPORTED
|
||||
type = 'medianotsupported';
|
||||
type = MediaError.MEDIA_NOT_SUPPORTED;
|
||||
break;
|
||||
default:
|
||||
// seeing cases where Edge is firing error events with no error code
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue