From aff2d29465f68861a1869e43e89c0695b9e4bc71 Mon Sep 17 00:00:00 2001 From: Rahim Alwer Date: Fri, 24 Nov 2023 11:10:48 +1100 Subject: [PATCH] fix(player): can use video presentation throwing closes #989 --- packages/vidstack/src/utils/support.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/vidstack/src/utils/support.ts b/packages/vidstack/src/utils/support.ts index 7139e370f..e89bb2da7 100644 --- a/packages/vidstack/src/utils/support.ts +++ b/packages/vidstack/src/utils/support.ts @@ -79,10 +79,11 @@ export function canUsePictureInPicture(video: HTMLVideoElement): boolean { * * @see {@link https://developer.apple.com/documentation/webkitjs/htmlvideoelement/1631913-webkitpresentationmode} */ -export function canUseVideoPresentation(video: HTMLVideoElement): boolean { +export function canUseVideoPresentation(video: HTMLVideoElement | null): boolean { if (__SERVER__) return false; return ( - isFunction(video.webkitSupportsPresentationMode) && isFunction(video.webkitSetPresentationMode) + isFunction(video?.webkitSupportsPresentationMode) && + isFunction(video?.webkitSetPresentationMode) ); }