Twine Tutorial: Autoplay Music

Getting music to play in the background of specific pages in a Twine game is relatively simple as long as the music comes from a YouTube video.

Screen Shot 2016-04-15 at 6.42.59 PM

Open the YouTube video where the music you want to autoplay is sourced. Under the actual video, second from the left you will see a tab labeled “share”, click it.

Screen Shot 2016-04-15 at 6.43.20 PM

After you click on it, the first tab that will appear will be a general share URL. Instead of using that link, click the link next to “share” labeled “embed”.

Screen Shot 2016-04-15 at 6.48.38 PM

A new link will appear that’s formatted with html coding. Highlight and copy the embed link.

Screen Shot 2016-04-15 at 6.43.33 PM

Open twine and click on the page box where you want the music the play.

Screen Shot 2016-04-15 at 6.43.49 PM

Copy and paste the embed link into the dialogue box for the page where you want the music to autoplay.

Screen Shot 2016-04-15 at 6.44.45 PM

Within the embed link is the URL for the YouTube video. Locate the URL and at the end, right before the quotation mark. Type in the following: ?autoplay=1

This will cause the video to automatically play.

Screen Shot 2016-04-15 at 6.45.15 PM

Locate where it says “width=” and “height=” within the embed link. Change the following number in quotation marks to zero. This will cause the video player to not appear which will make the music seem as if it’s playing in the background.

Close the dialogue box and save your game. The music should now play in the background.

Leave a Reply