Adler Ke
Adler Ke

Reputation: 3

How can I set autoplay to a vimeo video using embed tag?

I have the following embed tag in my html file

    <embed src='{{"https://player.vimeo.com/video/{$videouri}?autoplay=true"}}'width="300" height="361" /> 

Im having some trouble using the '?autoplay=true' and the '.play'(javascript). They just wont work for me. Any ideas on how to make it work?

Upvotes: 0

Views: 6433

Answers (1)

Davy de Vries
Davy de Vries

Reputation: 5143

If I look to the official Vimeo documentation this pops up:

<iframe src="https://player.vimeo.com/video/{{ $videouri }}?autoplay=true" width="300" height="361" frameborder="0" allow="autoplay"></iframe>

It looks like you have to add the following things:

  • Add ?autoplay=1 to the url (what you already did)
  • Add allow="autoplay" to the iframe element

Not sure if this also work for <embed> element.

side-note: If you use Laravel Blade you just can leave the url normal and add {{ $videouri }} to the url instead of double quoting the url and variable.

Upvotes: 1

Related Questions