Susant Patel
Susant Patel

Reputation: 55

React video tag keeps playing the video in loop. How can i stop it?

<div style={{ height: "100vh" }} className="clearance">
  <video width="100%" height="100%" controls>
    <source
      src={course?.courseAttachments?.attachmentUrl}
      type="video/mp4"
    />
  </video>
</div>

I have tried adding different attributes but the video starts again when it finishes running

Upvotes: 0

Views: 588

Answers (2)

Nikhil Reddy
Nikhil Reddy

Reputation: 11

did you try adding loop="false" attribute ?

Upvotes: 1

Geeky Quentin
Geeky Quentin

Reputation: 2508

Try changing your src to this:

src = {course?.courseAttachments?.attachmentUrl} + "&loop=false"

Upvotes: 0

Related Questions