uCoz Community » uCoz Modules » Additional Features » Music on the Site (How to add music .mp3, playlist so on...)
Music on the Site
Sunny
Posts: 9296
Reputation: 456

Message # 1 | 12:28 PM
You can insert mp3 player into any page or message. It may serve to let visitors listen to various compositions. It may be a background for you site (do not abuse this capability, don’t forget that mp3 files weight quite a lot, and not all users have broadband Internet access. They won’t be able to load your site in case of automatic playback)

It is used in the following way:
By means of the BB-code:

Code
[audio] [/audio]

Having entered the following
Code
[audio]http://forum.ucoz.com/i_love_ucoz.mp3[/audio]

we'll get

You can also insert a player with the help of JS-code.
To get it use Multimedia - > Insert audio (mp3)
or Multimedia - > Upload audio (mp3) [after uploading press JS-code near necessary file]
As a result, for the mp3 file at http://forum.ucoz.com/i_love_ucoz.mp3
we'll get the following code

Code
<script src="http://forum.ucoz.com/media/?auto=0;small=0;color=0055e9;textoff=0;t=audio;f=http%3A%2F%2Fforum.ucoz.com%2Fi_love_ucoz.mp3" type="text/javascript"></script>

You can also insert it into any place of your site. Besides, it has controlled parameters (settings), which we’ll describe below.

Quote
auto=0;small=0;color=0055e9;loop=0;textoff=0

Values in bold type may be changed from 0 to 1. In this way, you’ll enable them. By means of "color" specify code color.
So, if we change in the code
auto=0 for auto=1 - a song will be played automatically (be careful with this feature, think of those who have slow Internet and paid traffic).

small=1 – will display a small player of two buttons. Here it is:

loop=1 – a file will be played back non-stop (till you press stop)

textoff=1 – will remove text (e.g. "i_love_ucoz.mp3" in the example above)

color=0055e9 (player color management) –instead of 0055e9 write the code of a desired color. Codes can be found out from tables or in Photoshop by clicking on a color.
Example. Let’s take the code of the black color - 000000

Code
<script src="http://forum.ucoz.com/media/?auto=0;small=0;color=000000;textoff=0;t=audio;f=http%3A%2F%2Fforum.ucoz.com%2Fi_love_ucoz.mp3" type="text/javascript"></script>

we'll get:



Music as a background

Code
<bgsound src="URL" loop=5 volume=0 balance=0>

where
URL – file name
loop – number of repeats, if loop="infinite" - unlimited
format - .wav .mid

EMBED tag

It is used to insert into pages multimedia content and other files.

Code
<EMBED attributes> </EMBED>

  • height sets vertical size of embedded object

  • width sets horizontal size of embedded object

  • autostart sets possibility to start while loading, takes on the values "true" or "false"

  • loop sets number of repeats, takes on the values "true" or "false"

  • hidden allows to hide active module, takes on the values "true" or "false"

  • src specifies URL of a multimedia file

  • pluginspage specifies URL of the plug-in for playing back a multimedia file

  • bgcolor sets background of the object

  • type specifies multimedia file type

  • quality specifies multimedia file quality

  • alt sets alternative content

    Code
    <EMBED src="file.swf" menu="true" quality="high" bgcolor="#000066" width="760" height="410" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave"></EMBED>

    As you can see from the example you can insert Flash files, as well as video and audio.

    You can write a code with minimal number of attributes

    Code
    <embed src="video.avi" width="760" height="410">

    Music in a pop-up (new) window

    There is nothing difficult, use JavaScript

    On the page where you want to place the button "Play music" insert the following code between the < head> tags

    Code
    <script>
    function openWindow()
    {
    muzWindow = open("http://www.ucoz.com/music.html", "newWindow", "width=300,height=300, status=no, toolbar=no, menubar=no");
    }
    </script>

  • width=300 height=300 – width, height
  • http://www.ucoz.com/music.html – link to the page with your music

    Then put in any place of the page either the link

    Code

    <a href="#" onClick="openWindow()">Press to play music</a>

    or the button

    Code
    <button onClick="openWindow()">Press to play music</button>

    I'm not active on the forum anymore. Please contact other forum staff.
  • bodbreed
    Posts: 313
    Reputation: 1

    Message # 166 | 3:22 AM
    Paradox,what I mean by file archive is the slot where you are adding an entry in file catalog, its where you upload what the file you want be downloaded.

    Added (2012-11-29, 9:22 PM)
    ---------------------------------------------
    I think it's "$FILE_DIRECT_URL$"??

    Sunny
    Posts: 9296
    Reputation: 456

    Message # 167 | 12:35 PM
    XO-Ferg, yes, that's the direct link to an uploaded file.
    I'm not active on the forum anymore. Please contact other forum staff.
    bodbreed
    Posts: 313
    Reputation: 1

    Message # 168 | 2:46 AM
    Now that i've made my .mp3 files into .zip files, my automatic mp3 player doesn't work. Any suggestions?
    Paradox
    Old Guard
    Posts: 3284
    Reputation: 145

    Message # 169 | 3:23 AM
    XO-Ferg, you can't play compressed files. You need to keep them uncompressed. wink
    Jack of all trades in development, design, strategy.
    Working as a Support Engineer.
    Been here for 13 years and counting.
    bodbreed
    Posts: 313
    Reputation: 1

    Message # 170 | 6:36 PM
    Then if I make them uncompressed, they won't download, I can't win! lol

    Added (2012-12-03, 12:36 PM)
    ---------------------------------------------
    Lol wow, I can download the mp3 and the music player automatically generates now all of a sudden. I hope it stays like this! biggrin

    Admin-L2Creme
    Posts: 1
    Reputation: 0

    Message # 171 | 5:19 AM
    For some reasons Background music doesn't seems to work :/.

    I uploaded a .wave file at zippyshare and ye..

    <bgsound src="http://www62.zippyshare.com/d/89188713/729874/God_of_War_III_OST_Labour_Of_Destruction.wav" loop=1 volume=100 balance=0>

    This was my code, and i reloaded the page and nothing works..
    Sunny
    Posts: 9296
    Reputation: 456

    Message # 172 | 2:57 PM
    Admin-L2Creme, try to upload the file to your File Manager, click "JS-code" and use this code on your website. See the first post on these thread for more info (note: it should be an .mp3 file)
    I'm not active on the forum anymore. Please contact other forum staff.
    bodbreed
    Posts: 313
    Reputation: 1

    Message # 173 | 4:04 PM
    Can I use jplayer on my site?
    It doesn't have any .php files in it.

    Added (2012-12-31, 10:04 AM)
    ---------------------------------------------
    I have this code:

    <div style="display:inline-block;">
      <script type="text/javascript" src="http://www.webestools.com/page/js/flashobject.js"></script>
      <div id="lecteur_mp3_19635" style="display:inline-block;">
      <a href="http://get.adobe.com/fr/flashplayer/">You need to install the Flash plugin</a> - <a href="http://www.webestools.com/">Webestools</a> - <a href="http://www.webestools.com/mp3-player-flash-swf-generator-flash-mp3-player-fla-script-play-music-mp3-site.html">Flash Mp3 player Generator</a>
      </div>
      <script type="text/javascript">
      //<!--
      var flashvars_19635 = {};
      var params_19635 = {
      quality: "high",
      wmode: "transparent",
      bgcolor: "#ffffff",
      allowScriptAccess: "always",
      allowFullScreen: "true",
      flashvars: "url=$FILE_DIRECT_URL$&autostart=yes"
      };
      var attributes_19635 = {};
      flashObject("http://flash.webestools.com/mp3_player/s_11.swf", "lecteur_mp3_19635", "500", "35", "8", false, flashvars_19635, params_19635, attributes_19635);
      //-->
      </script>
    </div>

    How can I make it play whatever field is filled in, whether it's $FILE_DIRECT_URL$ or $RFILE_DIRECT_URL$?
    Paradox
    Old Guard
    Posts: 3284
    Reputation: 145

    Message # 174 | 4:53 AM
    XO-Ferg, I believe it should work. And use a conditional operator in the coding. wink
    Jack of all trades in development, design, strategy.
    Working as a Support Engineer.
    Been here for 13 years and counting.
    bodbreed
    Posts: 313
    Reputation: 1

    Message # 175 | 7:48 PM
    Ok thanks
    MitzZa1349
    Posts: 22
    Reputation: 0

    Message # 176 | 9:33 AM
    Can i download an .mp3 file instead of playing it? (Chrome browser)

    Tried a lot of scripts, but nothing sad

    Code
    <a href="file.mp3">Download mp3</a>
    Sunny
    Posts: 9296
    Reputation: 456

    Message # 177 | 12:52 PM
    MitzZa1349, that's not related to uCoz, it is a browser issue, google it. If you want your users to download mp3 files, just use the File Catalog module.
    I'm not active on the forum anymore. Please contact other forum staff.
    bodbreed
    Posts: 313
    Reputation: 1

    Message # 178 | 11:27 PM
    I've noticed that there are some playback issues "sometimes", when trying to play mp3/m4a files in an html5 audio players (only in google chrome) using mp3/m4a that are hosted on an ucoz website. Like the load time is kinda slow and "sometimes" fails. I've tested it in Internet Explorer, Firefox, Safari & Opera and they all work fine, except for in Google Chrome. Then I tried using an mp3 & m4a file hosted on a 3rd party site & it worked fine everytime.

    Added (2013-10-24, 5:27 PM)
    ---------------------------------------------

    Quote XO-Ferg ()
    I've noticed that there are some playback issues "sometimes", when trying to play mp3/m4a files in an html5 audio players (only in google chrome) using mp3/m4a that are hosted on an ucoz website. Like the load time is kinda slow and "sometimes" fails. I've tested it in Internet Explorer, Firefox, Safari & Opera and they all work fine, except for in Google Chrome. Then I tried using an mp3 & m4a file hosted on a 3rd party site & it worked fine everytime.


    Can anyone validate this?
    Here's a test page: http://www.ventlyfe.com/board....4-1-0-3
    Sunny
    Posts: 9296
    Reputation: 456

    Message # 179 | 1:58 PM
    XO-Ferg, yes, I can confirm the problem in Google Chrome. It has been forwarded to be analyzed.
    I'm not active on the forum anymore. Please contact other forum staff.
    bodbreed
    Posts: 313
    Reputation: 1

    Message # 180 | 4:36 PM
    Quote Sunny ()
    XO-Ferg, yes, I can confirm the problem in Google Chrome. It has been forwarded to be analyzed.


    Ok thanks.
    uCoz Community » uCoz Modules » Additional Features » Music on the Site (How to add music .mp3, playlist so on...)
    Search: