Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(web): stop Safari freezing after a seek in segment playback

Richie McIlroy9c84367f1549
diff --git a/apps/web/app/s/[videoId]/_components/HLSVideoPlayer.tsx b/apps/web/app/s/[videoId]/_components/HLSVideoPlayer.tsx
index 0993959fd..e287bbc10 100644
--- a/apps/web/app/s/[videoId]/_components/HLSVideoPlayer.tsx
+++ b/apps/web/app/s/[videoId]/_components/HLSVideoPlayer.tsx
@@ -382,12 +382,13 @@ export function HLSVideoPlayer({
...(isLiveSegments
? {
liveSyncDurationCount: 3,
+ // Safari's ManagedMediaSource freezes after a seek in segment
+ // playlists, so they use MediaSource wherever that exists.
+ preferManagedMediaSource: false,
// Early playback watches from the start while the playlist
- // grows, so it must never jump ahead to the live edge. Safari's
- // ManagedMediaSource freezes after a seek in these playlists,
- // so it uses MediaSource wherever that exists.
+ // grows, so it must never jump ahead to the live edge.
...(isEarlyPlayback
- ? { startPosition: 0, preferManagedMediaSource: false }
+ ? { startPosition: 0 }
: { liveMaxLatencyDurationCount: 6 }),
manifestLoadingRetryDelay: 2000,
manifestLoadingMaxRetry: 30,