1 reply [Last post]
Candi
Candi's picture
Offline
newbie
Last seen: 7 years 23 weeks ago
Timezone: GMT-6
Joined: 2012-07-04
Posts: 5
Points: 8

Hello,

How can I get background website music to play on the cellphone and tablet while viewing the site?

thanks

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 4 hours 22 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9757
Points: 3839

Use the object element to

Use the object element to embed the music file in the page. Keep in mind that if the visitor is listening to something already, or is in a place where the music would be poor manners, he may not appreciate your setting autoplay. Always leave it to the visitor to explicitly start any audio or video himself.

<object type="audio/mp3" 
        data="example.mpg">
  <param name="autoplay"
         value="false">
</object>

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.