Víctor Vidal
Víctor Vidal

Reputation: 1

Laravel and video mp4

I have a website with Laravel and I want to insert a video (mp4) but the video not working.

place the video in the public directory and in storage / public / video call it with:

 <video src="videos/people.mp4" autoplay="" loop=""></video>

Upvotes: 0

Views: 808

Answers (1)

Ben
Ben

Reputation: 71

Something is missing in your code, change it to:

<video controls width = "500">
        <source src = "{{asset ('videos/people.mp4')}}" type="video/mp4"></video>

• If you want an auto-read, add "autoplay muted" :

<video autoplay muted controls width = "500">
        <source src = "{{asset ('videos/people.mp4')}}" type="video/mp4"></video>

• And finally, if you want autoplay and repeat, add "loop" :

<video autoplay muted loop controls width = "500">
        <source src="{{asset ('videos/people.mp4')}}" type="video/mp4"></video>

Upvotes: 1

Related Questions