Stopping an audio mp3 file autoplaying on your page

When an MP3 file is dragged and dropped onto a Freeway page (or imported into an HTML item on the page), the default behavior is for it to "autoplay" on page load.

If you want to stop this happening, you need to use extended code on the item to switch autoplay off.

To do this, select the item on the page, go to Item>Extended, click on "New", enter "autoplay" (without the quotes) as the Name and "false" (again no quotes) as the Value.

Now when you preview in a browser you will see the QuickTime controller bar and the audio file will only play when the "Play" button is clicked.

Because the code that Freeway generates for playing audio files will work on the default media player for the machine it's being viewed on (Windows Media Player on Windows for instance), it's also a good idea to to add a second attribute that tells WMP to not autoplay. Again in the Extended dialog for the plugin item, click on "New", enter "autostart" (without the quotes) as the Name and "false" (again no quotes) as the Value.

If you find that an audio file still plays (which can be an issue on Chrome for Windows in some versions) you may need to add another piece of extended code. Select the item on the page, go to Item>Extended and enter "type" (without the quotes) for Name, enter "audio/mpeg" (again no quotes) for Value and click OK. This should then stop it autoplaying in Chrome for Windows.