feature: autoPlay when video changes

This commit is contained in:
Ilgeldi 2025-03-01 15:28:52 +05:00
parent fbda9a42f3
commit ce4d7348d3
1 changed files with 2 additions and 0 deletions

View File

@ -201,6 +201,7 @@ const VideoPlayer = ({ content, nextId }: { content: any; nextId: number }) => {
controlsList={data?.is_downloadable === 0 ? "nodownload" : ""} // Conditionally enable/disable download
poster={data?.banner_url}
playsInline
autoPlay={nextId !== 1}
onEnded={() => router.push(`${pathName}?video=${nextId}`)}
>
<source src={data?.video_stream_url} type="video/mp4" />
@ -223,6 +224,7 @@ const VideoPlayer = ({ content, nextId }: { content: any; nextId: number }) => {
controlsList={data?.is_downloadable === 0 ? "nodownload" : ""} // Conditionally enable/disable download
className="w-full rounded bg-white"
onEnded={() => router.push(`${pathName}?video=${nextId}`)}
autoPlay={nextId !== 1}
>
<source src={data?.content_url} />
</audio>