Last year, Baidu home player wrote a JS code, first record, do not support Firefox, another day with autio change

Source: Internet
Author: User

The player kernel is using object or embed

Just tested, the latest Firefox does not support, IE 360 can also use, another day to change audio to do it

Here, let's write it down.

Support next song, pause, start

The way to use it is simple:

The code is very simple, using JS implementation, the use of the method is very simple

1, introduced Css:<link href= "Css/stylesheet.css" rel= "StyleSheet" type= "Text/css"/>
2, introduced Js:<script src= "Js/jscript.music.js" type= "Text/javascript" ></script>

3, put a loading player div container <div id= "Music_panel" ></div>

4.

<script type= "Text/javascript" >varMUSIC =NewMusic ([{"Panel": "Music_panel", "Width": "380", "Height": "+", "AutoStart":true, "Image": "Webimg/album/20122027052035203540.jpg", "Url": "/webimg/music/20123927053922392250.mp3", "Music": [         { "Name": "We are all the same", "Singer": "Zhang Jie", "Singerlink": "javascript:void (0)", "Ablum": "xxx", "Ablumlink": "javascript:void (0)", "AutoStart":true, "Image": "Http://imgsrc.baidu.com/baike/pic/item/03087bf40ad162d976c9f6b511dfa9ec8a13cd70.jpg", "URL": "/HTTP// data1.act3.qq.com/2008-09-30/12/b8be62ce0758e958e05b24618befbef9.mp3?http%a4%84%b8a%e3%bf%c1%b9z/ Vfile.home.news.cn/music/public/vd2/200811/4.mp3 " },         { "Name": "My Song", "Singer": "Qu Wanting", "Singerlink": "javascript:void (0)", "Ablum": "xxx", "Ablumlink": "javascript:void (0)" , "AutoStart":true, "Image": "Http://apps3.bdimg.com/store/static/kvt/e4c9252bf227c4a6427756b84dfba94f.jpg", "URL": "/HTTP// Attachments.cngba.com/attachments/forum/201204/21/112846rgjkj55gyijerhji.mp3 " },         { "Name": "Possible", "Singer": "Li Xiaoyun Cloud", "Singerlink": "javascript:void (0)", "Ablum": "xxx", "Ablumlink": "javascript:void (0)", " AutoStart ":true, "Image": "http://picache.baidu.com/media?wd= Cda79d2e8563d8f5c0be992128d3f9a7a92166da4be8cee0642b4c7ebe9d354508f9a47d62b57d5d18d9de8b517fbb7b&src=http ://imgsrc.baidu.com/baike/pic/item/1b4c510fd9f9d72a5b3a31a3d42a2834349bbb35.jpg&def=local://neverfill "," Url ":" Http://zhangmenshiting.baidu.com/data2/music/27920867/2792075982800128.mp3?xcode= Ae9bd6c273a9739430b0581eb794ca53 " },         { "Name": "Still Love You", "Singer": "Leehom Wang", "Singerlink": "javascript:void (0)", "Ablum": "xxxx", "Ablumlink": "javascript:void (0)" , "AutoStart":true, "Image": "Http://apps3.bdimg.com/store/static/kvt/0aabc03602d739babdae4a1c6c07277f.jpg", "URL": "/HTTP// Music.huoxing.com/upload/20120702/1341183292277_4670.mp3? " },         { "Name": "Looking for Titanic", "Singer": "Pak", "Singerlink": "javascript:void (0)", "Ablum": "xxxx", "Ablumlink": "Javascript:void (0) "," AutoStart ":true, "Image": "http://picache.baidu.com/media?wd= Cda79d2e8563d8f5c0be992128d3f9a776d7488e0bbe49c433893dd621d3b49a7f219fd54aab780d488cdc128145efa3&src=http ://imgsrc.baidu.com/baike/abpic/item/a9d3fd1f4134970af3dad7ab95cad1c8a6865d8d.jpg&def=local://neverfill "," Url ":" Http://video11.ifeng.com/video06/2012/04/18/3bd579b3-7aa4-4d52-b228-4b1314797315.mp3 " },         { "Name": "Peach Blossom Luck", "Singer": "Yang yuying", "Singerlink": "javascript:void (0)", "Ablum": "xxxx", "Ablumlink": "javascript:void (0)", "AutoStart":true, "Image": "http://picache.baidu.com/media?wd= Cda79d2e8563d8f5c0be992128d3f9a7a92166da4be8cee0642b4c7ebe9d35459686508b4f8c9720a15ca53121973ac4&src=http ://data.yule.sohu.com/star/pic/star/1/1500/default.jpg&def=local://neverfill "," Url ":" http://m.61song.cn/ Songjin.net/yyy02/%cc%d2%bb%a8%d4%cb.wma?nbsp=&vsid=44b90565dc99188f6ad9deb9 " },          { "Name": "I like you very much", "Singer": "Six Zhe", "Singerlink": "javascript:void (0)", "Ablum": "xxxx", "Ablumlink": "javascript:void (0)" , "AutoStart":true, "Image": "Http://b.hiphotos.baidu.com/ting/pic/item/71cf3bc79f3df8dcc0010bd8cd11728b471028be.jpg", "URL": "http ://music1.tianya.cn/upmusicfile/2010/4/28/287846_33011389.mp3 " }          ]         }]); </script>

This document is reproduced in the address/attached download: Portal

More code access: Program Bar

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.