Website features do not need too much, their own needs of the good, their own blog slowly improve, a function of the increase, are their own needs and practical, they will cherish the hands!
The function of the music is simple, a piece of code:
<audio controls autoplay= "AutoPlay" loop= "loop" ><source src= "Http://lykezhan.com/test.mp3" type= "audio/ MPEG "/> If not played, your browser is not supported! </audio>
Plus there's going to be a player that shows
Believe anyone can understand, but a few notes, why do I have to add a "loop" behind? Isn't this a repetition of "autoplay"?
Yes, repeat, but not contradictory, my own site if not added "loop", it will not be automatically played.
For the sake of beauty I will also add hidden, hide the player, reach the point in the page to play
I only use music when I have very few and special pages!
Next, the code is written to the template page, and then the background Edit article page to add a text box to facilitate the input of the music address.
This is very convenient in the time to add the article at random, of course, in the special template, otherwise, each page will have to load a player, not to make the site become very bloated? So copy a new template page, when you need to add music to choose the template page!
Revision completed, I only in the "Life Diary" column added music function, template version of the Code to change:
<audio controls autoplay= "AutoPlay" loop= "loop" style= "Display:none;" ><source src= "{dede:field.shorttitle/}" type= "Audio/mpeg"/> If not played, your browser does not support! </audio>
Need to note is in the column where to modify the article content template!
How do I insert a music that plays automatically in my Web page? Use on any Web page