Setting up a YouTube video to autoplay in Swapcard
Updated over a week ago

When using a YouTube video ID on Swapcard, the video does not automatically play. Once the countdown ends and the video appears, users will need to press play, whether it is a live or pre-recorded video.

If you would like to have the video autoplay as soon as the countdown ends, you will need to opt for the use of the video iFrame instead.

To do so, you will first need to get the iFrame of the video in question from YouTube. For this, click on Share underneath the video and then Embed.

Screen_Shot_2021-05-13_at_09.31.35.png
Screen_Shot_2021-05-13_at_09.32.47.png

The iFrame will appear on the right hand side of the page. You will need to Copy the iFrame and paste it onto a text editing tool, such as Word or TextEdit.

Screen_Shot_2021-05-13_at_09.36.41.png

You will then need to edit the iFrame to enable the autoplay feature :

  1. Add ? right after the Video ID, and before the quotation mark.

  2. Hit Enter to take everything to the next line.

  3. Add &autoplay=1

  4. Copy this new code from your text editing tool and open this link to test it

  • Delete all the code in the left column.

  • Paste your new YouTube embed code.

  • Hit green Run button.

  • Video will play in the right window.

Go to the specified session in Swapcard Studio.

Select Live Session.

Select Other iFrame.

Paste embed code.

Example of iFrame code from YouTube

<iframe width="560" height="315" src="https://www.youtube.com/embed/B0Kwn1PliSQ"title="YouTube video player" frameborder="0" allowfullscreen></iframe>

Example of edited iFrame code with Autoplay capabilities (edits in bold)

<iframe width="560" height="315" src="https://www.youtube.com/embed/B0Kwn1PliSQ?&autoplay=1" title="YouTube video player" frameborder="0"</iframe>

You are all set! Your video will now play automatically at the start time of your session on Swapcard.

Did this answer your question?