From 06ccfa425fec89e578d15c3cfbfd2411734a5577 Mon Sep 17 00:00:00 2001 From: vineyardbovines Date: Tue, 21 Jul 2026 11:28:12 -0400 Subject: [PATCH] Fix HLS error exports across platforms --- .../VideoEmbedInner/VideoEmbedInnerWeb.native.tsx | 1 + .../VideoEmbedInner/VideoEmbedInnerWeb.shared.ts | 13 +++++++++++++ .../VideoEmbedInner/VideoEmbedInnerWeb.tsx | 15 ++------------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.native.tsx b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.native.tsx index 10e8c73236..75756ac35c 100644 --- a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.native.tsx +++ b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.native.tsx @@ -1,6 +1,7 @@ import {type VideoEmbedInnerWebProps} from './VideoEmbedInnerWeb.shared' export { + HLSFatalError, HLSUnsupportedError, VideoNotFoundError, } from './VideoEmbedInnerWeb.shared' diff --git a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.shared.ts b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.shared.ts index 06abf40408..d7c44b0d91 100644 --- a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.shared.ts +++ b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.shared.ts @@ -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 + } +} diff --git a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.tsx b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.tsx index 6973429c76..6ece8f5a9b 100644 --- a/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.tsx +++ b/src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerWeb.tsx @@ -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 = Promise & {value: undefined | T} const promiseForHls = import( // @ts-ignore