How to Make a Song Autoplay on Blogspot

Google's Blogspot blogging platform is capable of playing music automatically in your blog with the help of the HTML/JavaScript gadget, one of Blogspot's most useful and flexible widgets. Embedding music requires only a small amount of code with a link to the source file.

Instructions

  1. Coding

    • 1

      Locate the Web address or URL of the music file you want to use. If it is not online, upload the file to a Web host or file host first. Copy the complete URL, including the "http://."

    • 2

      Create a blank text document in Notepad or other plain text or HTML editor. Type the "<embed>" tag as follows:

      <embed></embed>

    • 3

      Type the "src" attribute inside the "<embed>" tag as follows:

      <embed src=""></embed>

    • 4

      Click between the quotes, right-click and click "Paste." This inserts the audio file URL in the value field in the tag. The code now looks as follows:

      <embed src="audio file here"></embed>

    • 5

      Type the attribute "autoplay" inside the "<embed>" tag just as you did the "src" tag. Enter a value of "true":

      <embed src="audio file here" autoplay="true" ></embed>

    • 6

      Add the attribute "hidden" in the tag if you want the music console to be invisible to the user. Otherwise, insert the "width" and "height" attributes and specify the dimensions of the music area. This example uses the "hidden" attribute:

      <embed src="url" autoplay="true" hidden ></embed>

      This example does not use the "hidden" attribute:

      <embed src="url" autoplay="true" width="100" height="30" ></embed>

    • 7

      Add the attribute "loop." Enter a value of "true" if you want the music to play perpetually; otherwise, enter "false":

      <embed src="url" autoplay="true" loop="false" hidden ></embed>

    • 8

      Click and drag the mouse cursor over the whole text, right-click and click "Copy."

    Embedding

    • 9

      Sign in to your Blogspot account. Click the drop-down arrow, then click "Layout."

    • 10

      Point the mouse cursor to where you want to embed the song. Click the "Add a Gadget" link within that area. In the "Basics" category, click "HTML/JavaScript."

    • 11

      Check to make sure you are in raw HTML mode. If you see the link "Edit HTML" on the right of the toolbar, click it; if you see "Rich Text," do not click it.

    • 12

      Click in the input box. Right-click and click "Paste" to insert the code you wrote earlier. Click "Save."

    • 13

      Click "View Blog." Turn on the sound on the computer and listen to the music to test it.

Tips & Warnings

  • If the song you want to play is from a third-party music site, it may have its own embedding code. Go to the source site and follow the directions for copying the media into a blog. You don't need to write your own code, just copy the provided code.

  • The "<embed>" tag is new in HTML 5, and is supported by all major browsers.

Related Searches:

References

Resources

Comments

Related Ads

Featured