Skip to content

Commit e854c65

Browse files
committed
Set start time to 1ms so safari autoplays
1 parent 4e241d3 commit e854c65

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dotcom-rendering/src/components/LoopVideoPlayer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ export const LoopVideoPlayer = forwardRef(
145145
css={videoStyles(width, height)}
146146
>
147147
{/* Only mp4 is currently supported. Assumes the video file type is mp4. */}
148-
<source src={src} type="video/mp4" />
148+
{/* The start time is set to 1ms so that Safari will autoplay the video */}
149+
<source src={`${src}#t=0.001`} type="video/mp4" />
149150
{fallbackImageComponent}
150151
</video>
151152
{ref && 'current' in ref && ref.current && isPlayable && (

0 commit comments

Comments
 (0)