From a1579eebad3a0223901ace4d3bd74e8ca3aeabef Mon Sep 17 00:00:00 2001 From: Loewy Date: Wed, 12 Aug 2026 14:15:50 -0700 Subject: [PATCH] Guard unsupported web orientation methods --- src/Video.web.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Video.web.tsx b/src/Video.web.tsx index 6802b9c5..c473ec89 100644 --- a/src/Video.web.tsx +++ b/src/Video.web.tsx @@ -139,15 +139,19 @@ const Video = forwardRef( navigationUI: 'hide', }); if (orientation === 'all' || !orientation || autorotate) { - screen.orientation.unlock(); - } else { + if (typeof screen.orientation?.unlock === 'function') { + screen.orientation.unlock(); + } + } else if (typeof screen.orientation?.lock === 'function') { await screen.orientation.lock(orientation); } } else { if (document.fullscreenElement) { await document.exitFullscreen(); } - screen.orientation.unlock(); + if (typeof screen.orientation?.unlock === 'function') { + screen.orientation.unlock(); + } } } catch (e) { // Changing fullscreen status without a button click is not allowed so it throws.