about summary refs log tree commit diff
path: root/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-09-04 08:06:58 -0700
committerGitHub <noreply@github.com>2024-09-04 08:06:58 -0700
commitd94ff2695db945b49b88d47c1a3d0b85d8b939e0 (patch)
tree6237d1323fb2913c9b33a57607e1d9082a9b5cd9 /src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx
parentdee28f378a815e6518a010a293733b26ae7bed9c (diff)
downloadvoidsky-d94ff2695db945b49b88d47c1a3d0b85d8b939e0.tar.zst
[Video] Throw error when playback fails (#5132)
Diffstat (limited to 'src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx')
-rw-r--r--src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx b/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx
index 913fca568..ad844b93d 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])