Use jQuery to design a simple web music player instance sharing _ jquery

Source: Internet
Author: User
This article mainly introduces how to use jQuery to design a simple web music player instance, including the implementation of basic functions such as the PHP background and reading tracks from MySQL. For more information, see I. Prepare a database
First, we design the MYSQL database as follows:

CREATE TABLE `songs` ( `song_id` int(11) NOT NULL AUTO_INCREMENT, `url` varchar(500) NOT NULL, `artist` varchar(250) NOT NULL, `title` varchar(250) NOT NULL, PRIMARY KEY (`song_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

Here, the url field indicates the address where mp3 music is stored, artist is the Song artist, and title is the song name. Let's add some sample data, as shown below:

INSERT INTO `songs` (`song_id`, `url`, `artist`, `title`) VALUES ('', 'http://mysongs.com/songurl.mp3', 'Artist name', 'Song name');INSERT INTO `songs` (`song_id`, `url`, `artist`, `title`) VALUES ('', 'http://mysongs.com/anothersongurl.mp3', 'Another artist', 'Another song');INSERT INTO `songs` (`song_id`, `url`, `artist`, `title`) VALUES ('', 'http://mysongs.com/onemoresongurl.mp3', 'One more artist', 'One more song');

2. Design HTML pages
After designing the database, we can design the HTML page. Here we first need to download a music player plug-in jPlayer (http://jplayer.org/) for jQuery /). Decompress the downloaded package and put the content of the js and skin folders under the root directory of your application. They are the javascript files and CSS style application files to be used. Now you can open the HTML page and name it demo.html. The Code is as follows:

  Online radio using jQuery  
   
   

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.