Showing posts with label HTML5. Show all posts
Showing posts with label HTML5. Show all posts

Wednesday, February 8, 2012

A test of blog's BGM using HTML5


W3Schools.com have had many information about standard of W3C.
Especially It announced HTML5 tutorials. It's very useful for me.

http://www.w3schools.com/html5/default.asp

Some blogs have a background music such as BGM.
Most of all are used windows media player in Internet Explorer.

This sample used <audio> tag of HTML5.
I set auto play and hided controls. Maybe you can listen to music in this post.

Of course, It can be played in a browser that support <audio> tag of HTML5.
Under Internet Explorer 8, you saw just some text.

The source is as follows.
In the below source it is set control and repeat.


<audio autoplay="autoplay" loop="loop" controls="controls">
  <source src="rain.mp3" type="audio/mpeg" />
  <source src="rain.ogg" type="audio/ogg" />
</audio>

I tested at mobile environment.
Android is a fully working  auto play.
Though iPhone support HTML5, it is not working auto play.
Only when the user clicks, the music is playing.