I am brand new to CSS and I was wondering if there was a way to insert music into a website. What I'm looking for is the type of music you hear right away and continuously when you go to a movie website. It plays when you enter the website and it just loops until you close the website. Like this website (once you get past the trailer) http://wwws.warnerbros.es/crazystupidlove/index.html. Thanks to anyone who can help me!
I would also voice my opinion on this - don't do it. Add a player people can interact with for sure, but having music start up when browsing is a huge no no. I would close the site immediately.
Remember lots of people listen to their own music while browsing...
Adding my $0.02, I'd like to say "don't do it" as well. Having autoplay audio is an instant tab killer for me, unless I absolutely have to use the site. Having the option might be nice, like Robskiwarrior said, but don't make it play by default. If, for some reason you absolutely must put autoplay music on the site, make sure that your users can easily see (and kill) the player. I listen to music while browsing, and I find it absolutely infuriating when I open up a couple tabs and have music start playing in one of them, and not be able to easily tell by looking at the pages which one the music's coming from. Making the player hidden and inaccessible, and you've earned my eternal enmity.
The only reason I could see making audio autoplay is if it's something like a podcast episode's page, and you make sure that the user knows the autoplay is coming, and they can still disable it easily. That's about it, however, and I personally would still prefer to start the audio manually.
Unfortunately I had a client (Afghan Restaurant web site) just yesterday who demanded music be installed on his site, and have it auto-playing. There was nothing I could do, except give him my insight on why it is a bad idea, but he didn't care. I searched high and dry yesterday looking for a nice html5 audio player "skinned" plugin (cross browser compatible) without any luck. I ended up using "jplayer" and used the audio he referenced. I will try custom skinning the player later today.
I can only hope this customer will receive many complaints on this audio auto-playing audio feature so I can remove it in the future lol.
There is no way to do this with just CSS either, you need a combination of HTML and most likely Flash or JavaScript.
Remember lots of people listen to their own music while browsing...
The only reason I could see making audio autoplay is if it's something like a podcast episode's page, and you make sure that the user knows the autoplay is coming, and they can still disable it easily. That's about it, however, and I personally would still prefer to start the audio manually.
(No guarantees how long that will be there or if it will stay the same)
And yea. autoplay = generally bad. option to play music = sometimes cool.
I can only hope this customer will receive many complaints on this audio auto-playing audio feature so I can remove it in the future lol.