CommonSenseCode
CommonSenseCode

Reputation: 25359

How to autoplay iframe with video in Chrome

I googled answer and didn't find any for this. How can you autoplay videos in chrome. This is what I have tried:

<iframe allow="fullscreen; autoplay" allowfullscreen="true" src="https://example.com"></iframe>

Upvotes: 2

Views: 14212

Answers (4)

Amit Mundra
Amit Mundra

Reputation: 166

In order to autoplay a video, the iframe needs to include autoplay=1 in the src property and allow=autoplay property as well.

<iframe src="https://example.com?autoplay=1" allow="autoplay"></iframe>

Upvotes: 0

Prathap Senadeera
Prathap Senadeera

Reputation: 1

simply add autoplay function to your code: "?autoplay=1" after the link (inside the double quotation marks).

<iframe src="https://example.com?autoplay=1"></iframe>

refer this will explain you better.

Upvotes: 0

zimejin
zimejin

Reputation: 1

There's surprisingly little info on this around. After much searching, I found this to work.

To modify the code to include an autoplay function, simply insert this after the alphanumeric code:

?rel=0;&autoplay=1

Example:

<iframe width="560" height="315" 
    src="https://www.youtube.com/embed/iG9CE55wbtY?rel=0;&autoplay=1" frameborder="0" 
    allowfullscreen>
</iframe>

Reference: https://support.gospacecraft.com/hc/en-us/articles/202694610-Set-Video-to-Autoplay

Upvotes: 0

CommonSenseCode
CommonSenseCode

Reputation: 25359

I found answer in internet but not in stackoverflow so I would leave it here so someone can find it:

        <iframe allow="autoplay *; fullscreen *" allowfullscreen="true" 
          src="https://example.com">
        </iframe>

Upvotes: 5

Related Questions