
Last Update: February 20, 2025
BY
eric
|Loading...
Keywords
I used Sora to create a video and tried to use it in Next.js. However, I ran into an issue where the video wouldn't autoplay as expected. The video is loaded but not being played.
Below was the original code block that I was working on:
jsx
export default function Page() {
return (
<div>
<h1>Video</h1>
<video autoplay muted loop>
{/* This is not the video I created with Sora*/}
<source src="https://upload.wikimedia.org/wikipedia/commons/0/09/Frozen_drop.webm" type="video/webm" />
Your browser does not support the video tag.
</video>
</div>
);
}
It turned out the solution was so simple, and I only needed to change the autoplay attribute to autoPlay="true" or literally anything like autoPlay="autoplay" or even autoPlay="" in the video tag.
Here's the updated code block:
jsx
export default function Page() {
return (
<div>
<h1>Video</h1>
<video autoPlay="true" muted loop>
{/* This is not the video I created with Sora*/}
<source src="https://upload.wikimedia.org/wikipedia/commons/0/09/Frozen_drop.webm" type="video/webm" />
Your browser does not support the video tag.
</video>
</div>
);
}
Here is my Video:
Enjoy, and happy coding!






Comments (0)
Leave a Comment