Fix HLS error exports across platforms
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {type VideoEmbedInnerWebProps} from './VideoEmbedInnerWeb.shared'
|
||||
|
||||
export {
|
||||
HLSFatalError,
|
||||
HLSUnsupportedError,
|
||||
VideoNotFoundError,
|
||||
} from './VideoEmbedInnerWeb.shared'
|
||||
|
||||
@@ -19,3 +19,16 @@ export class VideoNotFoundError extends Error {
|
||||
super('Video not found')
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fatal hls.js playback error. `detail` is the hls.js error details code
|
||||
* (e.g. bufferAppendError), which buckets failures more usefully than the
|
||||
* error message.
|
||||
*/
|
||||
export class HLSFatalError extends Error {
|
||||
detail: string
|
||||
constructor(detail: string, cause: Error) {
|
||||
super(cause.message, {cause})
|
||||
this.detail = detail
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import {AltBadgeWithDialog} from '#/components/AltBadgeWithDialog'
|
||||
import {useFullscreen} from '#/components/hooks/useFullscreen'
|
||||
import * as BandwidthEstimate from './bandwidth-estimate'
|
||||
import {
|
||||
HLSFatalError,
|
||||
HLSUnsupportedError,
|
||||
type VideoEmbedInnerWebProps,
|
||||
VideoNotFoundError,
|
||||
@@ -17,6 +18,7 @@ import {
|
||||
import {Controls} from './web-controls/VideoControls'
|
||||
|
||||
export {
|
||||
HLSFatalError,
|
||||
HLSUnsupportedError,
|
||||
VideoNotFoundError,
|
||||
} from './VideoEmbedInnerWeb.shared'
|
||||
@@ -135,19 +137,6 @@ function canPlayBskyVideoCodecs(): boolean {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Fatal hls.js playback error. `detail` is the hls.js error details code
|
||||
* (e.g. bufferAppendError), which buckets failures more usefully than the
|
||||
* error message.
|
||||
*/
|
||||
export class HLSFatalError extends Error {
|
||||
detail: string
|
||||
constructor(detail: string, cause: Error) {
|
||||
super(cause.message, {cause})
|
||||
this.detail = detail
|
||||
}
|
||||
}
|
||||
|
||||
type CachedPromise<T> = Promise<T> & {value: undefined | T}
|
||||
const promiseForHls = import(
|
||||
// @ts-ignore
|
||||
|
||||
Reference in New Issue
Block a user