發新話題

在GOOGLE博客裡加音樂播放器源代碼

在GOOGLE博客裡加音樂播放器源代碼

訪客無法瀏覽此圖片或連結,請先 註冊登入會員
New Visitor? Like what you read? Then please subscribe to my 訪客無法瀏覽此圖片或連結,請先 註冊登入會員 or sign up for 訪客無法瀏覽此圖片或連結,請先 註冊登入會員 Thanks for Visiting!
Background music in blogs and websites is not appreciated by many viewers since it disturbs attention, gathers unwanted attention and wastes bandwidth. However there are many methods to do this and many websites catering to this demand......

The first requirement is to have your music file ready and upload it to a freehost like Googlepages. If you can't create an account at Googlepages create a group at Google Groups and this gives you 100 MB free space for files. Next upload your file to the freehost and copy down its link or URL.


The simplest solution is to use the embed tag to put the file in your page. Login to Dashboard and go to Layouts. This opens the Page Elements tab in which click on Add Page Element in the sidebar. Choose the Html/Javascript option and paste this code under contents :

<EMBED src="LINK OF SOUND FILE AT FREE HOST" autostart=true loop=false volume=100 hidden=true><NOEMBED><BGSOUND src="NAME OF FILE"></NOEMBED>

Replace the CAPS in above code and Save. When you put autostart=true then the file will start playing as soon as the page is loaded. You can put "FALSE" instead of "TRUE" so the person visiting your page will have to click on the play button for it to start. Loop=true makes the file to play again and again. Use this for small files like birdsongs which can continuously play in the background.



MP3 FILES
Upload your MP3 file in the same way as above. Then open Notepad and type in :

http://www.googlepages.com/file.mp3

This is the link to your uploaded MP3 file at Googlepages. Save this file as Mysong.m3u and upload this file as well to Googlepages. Login to your Dashboard and select Layouts which opens the Page Elements tab. Click Add Page Element in sidebar and select Html/Javascript option and paste the following code under contents :

<EMBED src="Mysong.m3u" autostart=true hidden=true>

Save. You can also use Google Gadgets to put a MP3 player in your blog as shown in 訪客無法瀏覽此圖片或連結,請先 註冊登入會員 .


MP3 PLAYLISTS
For playing MP3 Playlists you require Flash MP3 Players. 訪客無法瀏覽此圖片或連結,請先 註冊登入會員
You can find these by Googling for them. Some are available at sites like 訪客無法瀏覽此圖片或連結,請先 註冊登入會員 , 訪客無法瀏覽此圖片或連結,請先 註冊登入會員 or 訪客無法瀏覽此圖片或連結,請先 註冊登入會員
Download one of these and upload them to your Googlepages account. Copy down the link to the flash player file.


Next upload all your songs to a freehost like Googlepages and copy down their URLs. After that open Notepad and paste their links as shown below :

<?xml version="1.0" encoding="UTF-8"?>
<player showDisplay="yes" showPlaylist="yes" autoStart="random">
<song path="LINK TO MP3 FILE 1" title="FILE1 TITLE" />
<song path="LINK TO MP3 FILE 2" title="FILE2 TITLE" />
<song path="LINK TO MP3 FILE 3" title="FILE3 TITLE" />
<song path="LINK TO MP3 FILE 4" title="FILE4 TITLE" />
<song path="LINK TO MP3 FILE 5" title="FILE5 TITLE" />
<song path="LINK TO MP3 FILE 6" title="FILE6 TITLE" />
<song path="LINK TO MP3 FILE 7" title="FILE7 TITLE" />
</player>

Save this file as MyPlaylist.xml and upload it to your Googlepages account. Copy down the link to the file. Login to dashboard and click on Layouts. This will open the Page Elements tab in which click on Add Page Element and choose Html/Javascript option. Paste the following code under contents and save :

<embed pluginspage="http://www.macromedia.com/go/getflashplayer" width="230" src="LINK TO FLASH PLAYER FILE" height="280"
type="application/x-shockwave-flash"
flashvars="playlist=LINK OF YOUR MYPLAYLIST.XML AT GOOGLEPAGES&autostart=true"/></embed>

Save the changes. Refresh cache and view blog.

TOP

發新話題

本站所有圖文均屬網友發表,僅代表作者的觀點與本站無關,如有侵權請通知版主會盡快刪除。