Fix HLS error exports across platforms

This commit is contained in:
vineyardbovines
2026-07-21 11:28:12 -04:00
parent 4bd23313d4
commit 06ccfa425f
3 changed files with 16 additions and 13 deletions
@@ -1,6 +1,7 @@
import {type VideoEmbedInnerWebProps} from './VideoEmbedInnerWeb.shared' import {type VideoEmbedInnerWebProps} from './VideoEmbedInnerWeb.shared'
export { export {
HLSFatalError,
HLSUnsupportedError, HLSUnsupportedError,
VideoNotFoundError, VideoNotFoundError,
} from './VideoEmbedInnerWeb.shared' } from './VideoEmbedInnerWeb.shared'
@@ -19,3 +19,16 @@ export class VideoNotFoundError extends Error {
super('Video not found') 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 {useFullscreen} from '#/components/hooks/useFullscreen'
import * as BandwidthEstimate from './bandwidth-estimate' import * as BandwidthEstimate from './bandwidth-estimate'
import { import {
HLSFatalError,
HLSUnsupportedError, HLSUnsupportedError,
type VideoEmbedInnerWebProps, type VideoEmbedInnerWebProps,
VideoNotFoundError, VideoNotFoundError,
@@ -17,6 +18,7 @@ import {
import {Controls} from './web-controls/VideoControls' import {Controls} from './web-controls/VideoControls'
export { export {
HLSFatalError,
HLSUnsupportedError, HLSUnsupportedError,
VideoNotFoundError, VideoNotFoundError,
} from './VideoEmbedInnerWeb.shared' } 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} type CachedPromise<T> = Promise<T> & {value: undefined | T}
const promiseForHls = import( const promiseForHls = import(
// @ts-ignore // @ts-ignore