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.
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.
You will then need to edit the iFrame to enable the autoplay feature :
- Add ? right after the Video ID, and before the quotation mark.
- Hit Enter to take everything to the next line.
- Add &autoplay=1
- 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.
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.