You can easily trigger a YouTube or Vimeo video to automatically play when a user lands on your site.
Note: The autoplay feature does not work on mobile or tablet devices.
1. Copy the embed code from the Share tab on the video’s page on YouTube/Vimeo, and then paste the code into the video block.
EXAMPLE: The normal embed share code will look like this for Youtube:
<iframe width="560" height="315" src="https://www.youtube.com/embed/EVnjZnJ5_cg" frameborder="0" allowfullscreen></iframe>
EXAMPLE: The normal embed share code will look like this for Vimeo:
<iframe src="https://player.vimeo.com/video/161181924" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
For YouTube Videos:
Note: Due to automatic browser settings, a video cannot autoplay if the volume is on. The video will need to be muted if you want it to autoplay. If you are wanting to customize the view, volume, autoplay features, and Youtube deliverables (share, recommended videos, etc.) we recommend using an HTML block to enter in your embed code.
1. You will only need to modify a small part of the code YouTube gives you. Copy and paste this code into a HTML block:
<iframe width=“560” height=“315" src=“https://www.youtube.com/embed/iG9CE55wbtY?rel=0;&autoplay=1&mute=1&loop=1&playlist=iG9CE55wbtY” frameborder=“0" allowfullscreen include></iframe>
2. Change the Alphanumeric Code that appears between embed/ and ?rel=0. In this case, the code to replace is iG9CE55wbtY. (The next step tells you what to replace it with.)
3. Grab your video's code from your Youtube Video. Click on the Share button for the video, and then the Embed Code icon to get the embed share code. Be sure to only copy and paste the alphanumeric code that you will need to replace the example above.<iframe width=“560” height=“315" src=“https://www.youtube.com/embed/INSERTCODErel=0;&autoplay=1&mute=1&loop=1&playlist=INSERTCODE” frameborder=“0" allowfullscreen include></iframe>
4. Select the green Publish button to make your changes live.
For Vimeo Videos:
1. To modify the code to include an autoplay function, you will want to add this code to an HTML Block:
<iframe src="https://player.vimeo.com/video/305795958?background=1&autoplay=1&;title=0&;byline=0&;portrait=0&;loop=1&;autopause=0&;muted=1" width="640" height="360" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe>
2. Replace the video ID in the code with the video ID from your Vimeo video. The video id is the number that immediately follows player.vimeo.com/video/ and ends before the ? symbol. In the above code, the video ID is the number 305795958. Replace that code with your video's ID.
3. Select the green Publish button to make your changes live.