From d94ff2695db945b49b88d47c1a3d0b85d8b939e0 Mon Sep 17 00:00:00 2001 From: Hailey Date: Wed, 4 Sep 2024 08:06:58 -0700 Subject: [PATCH] [Video] Throw error when playback fails (#5132) --- .../VideoEmbedInner/VideoEmbedInnerNative.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx b/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx index 913fca56..ad844b93 100644 --- a/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx +++ b/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx @@ -101,9 +101,18 @@ function VideoControls({ setTimeRemaining(secondsRemaining) }, ) + const statusSub = player.addListener( + 'statusChange', + (status, _oldStatus, error) => { + if (status === 'error') { + throw error + } + }, + ) return () => { volumeSub.remove() timeSub.remove() + statusSub.remove() } }, [player])