diff --git a/src/client/channel/components/ChannelMedia.tsx b/src/client/channel/components/ChannelMedia.tsx index a3571e607..b19def4a7 100644 --- a/src/client/channel/components/ChannelMedia.tsx +++ b/src/client/channel/components/ChannelMedia.tsx @@ -42,7 +42,9 @@ export interface WatchReceiving { export function WatchPeerAction({ receiving }: { receiving: WatchReceiving }) { const { t } = useCopy(); if (!receiving.peerAvailable && receiving.mode !== "peer" || receiving.mode === "peer" && !receiving.failed) return null; - return receiving.peerSupported ? : {t("watch.forward.secure")}; } @@ -64,7 +66,7 @@ function WatchPlaybackSettings({ receiving, playback, children, audioAvailable = {receiving && <>{t("watch.forward.viewing")}

{t("watch.forward.receiveHelp")}

{receiving.peerSupported ? + || receiving.mode === "peer"} busy={receiving.pending} onClick={receiving.onPeer} /> : {t("watch.forward.secure")}} {receiving.browserSource && }} @@ -197,7 +199,7 @@ export function ChannelWatchVideo({ player, owned, paused, label, presentation, ? : !(receiving?.peerAvailable && receiving.peerSupported) && (originalPageUnavailable ? {originalPageUnavailable} : originalPageAvailable && {t("watch.connectApp")}))} - {receiving && } + {receiving && } : player.blocked &&
} {hasControls &&
diff --git a/tests/watch-peer-errors.test.ts b/tests/watch-peer-errors.test.ts index 1a65031d6..2aba80dbe 100644 --- a/tests/watch-peer-errors.test.ts +++ b/tests/watch-peer-errors.test.ts @@ -50,8 +50,8 @@ test.each([ }); test.each([ - { status: 401, details: Hls.ErrorDetails.FRAG_LOAD_ERROR, type: Hls.ErrorTypes.NETWORK_ERROR, expected: "watch_media_unavailable" }, - { status: 403, details: Hls.ErrorDetails.FRAG_LOAD_ERROR, type: Hls.ErrorTypes.NETWORK_ERROR, expected: "watch_media_unavailable" }, + { status: 401, details: Hls.ErrorDetails.FRAG_LOAD_ERROR, type: Hls.ErrorTypes.NETWORK_ERROR, expected: "watch_media_access_denied" }, + { status: 403, details: Hls.ErrorDetails.FRAG_LOAD_ERROR, type: Hls.ErrorTypes.NETWORK_ERROR, expected: "watch_media_access_denied" }, { status: 0, details: Hls.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR, type: Hls.ErrorTypes.MEDIA_ERROR, expected: "watch_media_unsupported" }, ])("typed HLS $status/$details wins over generic platform source rejection", async value => { const attached = nextHlsAttachment(); diff --git a/tests/watch-presentation.test.ts b/tests/watch-presentation.test.ts index 5b9a367ad..5ce85b434 100644 --- a/tests/watch-presentation.test.ts +++ b/tests/watch-presentation.test.ts @@ -206,7 +206,7 @@ describe("Webpage watch presentation", () => { expect(render()).toContain('aria-label="Receive from sharer"'); expect(render({ peerAvailable: false })).toBe(""); expect(render({ mode: "peer" })).toBe(""); - expect(render({ mode: "peer", failed: true })).toContain('aria-label="Receive from sharer"'); + expect(render({ mode: "peer", failed: true })).toContain('aria-label="Retry"'); expect(render({ mode: "peer", failed: true, peerAvailable: false })).toMatch(/]*disabled/); expect(render({ peerSupported: false })).toContain("trusted HTTPS address"); expect(render({ peerSupported: false })).not.toContain("