From 963bb8cac00d9367316aab357717480484e26a36 Mon Sep 17 00:00:00 2001 From: Rahim Alwer Date: Mon, 29 Apr 2024 21:26:40 +1000 Subject: [PATCH] fix(player): media session check throwing during ssr --- packages/vidstack/src/components/player.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vidstack/src/components/player.ts b/packages/vidstack/src/components/player.ts index 1a1270b33..f3be0b441 100644 --- a/packages/vidstack/src/components/player.ts +++ b/packages/vidstack/src/components/player.ts @@ -194,7 +194,7 @@ export class MediaPlayer context, ); - if ('mediaSession' in navigator) { + if (typeof navigator !== 'undefined' && 'mediaSession' in navigator) { new NavigatorMediaSession(); }