50 users online (1 members and 49 guests)  

Thread: Web Radio


  Results 1 to 6 of 6

Related

  1. Radio Buttons Return Nothing    Forum: HTML Forum
    Replies: 7
  2. Radio Button in PHP    Forum: PHP Forum
    Replies: 3
  3. Web Radio    Forum: HTML Forum
    Replies: 0
  4. web radio    Forum: Javascript Forum
    Replies: 2
  5. radio buttons    Forum: HTML Forum
    Replies: 2
  1. #1
    HTMLChica's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2002
    Location
    IA
    Posts
    1

    Question Web Radio

    HELP!:help: I have a teen website that's mostly about dollz and music. Well, I have a selection of Midi files, and I want a way to have them all available to listen to all throughout the website. I wondered about doing a loop background sound, but I know this can become very annoying to visitors, especially if they don't like the song. So I want my guests to be able to chose the song they with to listen to.

    I have a plan to utilize, which is place each song embedded on a seperate webpage, and have a drop-down menu in my Navagation frame that links to a song pade, that is targeted to a music frame within the navagation area. With an approximate of 30 songs I would like to include, this becomes very time consuming and tiring.

    I wondered if anyone has any better suggestions for me, or any other way to help me put a radio on my website!

    Thanx!


  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hiya, welcome to the forums.

    This should do the trick, its useable in itself, but more importantly it shows you how to access embedded sound objects using JavaScript -
    http://www.wilrose.com/JSRadio.shtml

    Hope that does the trick.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316

    RE

    if u want a separate popup jukebox, go here
    http://javascriptkit.com/script/cut100.shtml

    if u want the player to be on your website and target a frame then try this (this isnt my script so please leave the acknowledgement

    <head><Script Language="JavaScript">
    <!-- Hiding
    // Script by Lefteris Haritou : http://www.geocities.com/~lef
    // Courtesy or SimplytheBest.net (http://simplythebest.net/info/dhtml_scripts.html)
    song = new Array()
    var x = 0
    song[1] = "Songname # 1"
    song[2] = "Songname # 2"
    song[3] = "Songname # 3"
    song[4] = "Songname # 4"
    song[5] = "Songname # 5"
    song[6] = "Songname # 6"
    function prev(){
    if (x>1)
    { x--
    document.midi.typein.value=song [x]
    }
    }
    function next(){
    var max= song.length-1
    if (x<max)
    { x++
    document.midi.typein.value=song [x]
    }
    }
    function go(){
    if (x != 0){
    location.href='song'+x+'.mid'
    }
    }
    function start(){
    x=1
    document.midi.typein.value=song [x]
    }
    function end(){
    x=song.length-1
    document.midi.typein.value=song [x]
    }
    function cls(){
    document.midi.typein.value="Select Midi Song"
    }
    // Done Hiding -->
    </Script></head><body>
    <!-- put this wherever u want it to show, u can target it to a frame if u want (u'll have to look thru the code yourself i just copied it from the website, no time to comment -->
    <form name="midi">
    <input name="typein" type="text" size="25" align=top><br>
    <font size=3 face="arial">
    <input type=button value="|<<" align=left onclick="start()">
    <input type=button value="<<" align=left onclick="prev()">
    <input type=button value="PLAY" align=left onclick="go()">
    <input type=button value=">>" align=left onclick="next()">
    <input type=button value=">>|" align=left onclick="end()">
    </form></body>

  4. #4
    Lady_Soul2's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2002
    Location
    Missouri
    Posts
    3

    Smile

    Ok. I'm looking at the script and can't figure where to put the music in the script. Please simplefy it for me, for I am a simple type of girl.

  5. #5
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316
    put the path of the wav files here.
    if u have more than 6 songs then just continue adding them into the array. for example :
    song[30] = "url/filename30.wav"

    ***********start code**************
    song[1] = "url/filename.wav"
    song[2] = "url/filename.wav"
    song[3] = "url/filename.wav"
    song[4] = "url/filename.mid"
    song[5] = "url/filename.wav"
    song[6] = "url/filename.mid"
    *************end code*************

    this goes in between <head> and </head>

    ********start code***********
    <Script Language="JavaScript">
    <!-- Hiding
    // Script by Lefteris Haritou : http://www.geocities.com/~lef
    // Courtesy or SimplytheBest.net (http://simplythebest.net/info/dhtml_scripts.html)
    song = new Array()
    var x = 0
    song[1] = "Songname # 1"
    song[2] = "Songname # 2"
    song[3] = "Songname # 3"
    song[4] = "Songname # 4"
    song[5] = "Songname # 5"
    song[6] = "Songname # 6"
    function prev(){
    if (x>1)
    { x--
    document.midi.typein.value=song [x]
    }
    }
    function next(){
    var max= song.length-1
    if (x<max)
    { x++
    document.midi.typein.value=song [x]
    }
    }
    function go(){
    if (x != 0){
    location.href='song'+x+'.mid'
    }
    }
    function start(){
    x=1
    document.midi.typein.value=song [x]
    }
    function end(){
    x=song.length-1
    document.midi.typein.value=song [x]
    }
    function cls(){
    document.midi.typein.value="Select Midi Song"
    }
    // Done Hiding -->
    </Script>
    *************end code************

    the rest of the code, add it where u want it to show.

    *************start code************
    <form name="midi">
    <input name="typein" type="text" size="25" align=top><br>
    <font size=3 face="arial">
    <input type=button value="|<<" align=left onclick="start()">
    <input type=button value="<<" align=left onclick="prev()">
    <input type=button value="PLAY" align=left onclick="go()">
    <input type=button value=">>" align=left onclick="next()">
    <input type=button value=">>|" align=left onclick="end()">
    </form>
    *************end code************

    make sure your song page is separate, because 30 midi's take a LONG time to download. a standard 56.6 kb line would take a whole minit, assuming the midi's are 3 kbs on average. surfers dont like waiting more than 10 seconds

    have fun

  6. #6
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316
    or u could try this one. hope it helps

    TWO STEPS TO INSTALL MIDI MENU:

    1. Copy the coding into the HEAD of your HTML document
    2. Add the last code into the BODY of your HTML document

    <!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

    <HEAD>

    <SCRIPT LANGUAGE="JavaScript">
    <!-- Original: Nicholas Loar -->
    <!-- Web Site: http://www.cass.net/~anarchy -->

    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->

    <!-- Begin
    songNum = new Array();
    songNum[0] = "#";
    songNum[1] = "http://javascript.internet.com/img/midi-menu/whiskey.mid";
    songNum[2] = "http://javascript.internet.com/img/midi-menu/aeroplane.mid";
    songNum[3] = "http://javascript.internet.com/img/midi-menu/christina.mid";
    songNum[4] = "http://javascript.internet.com/img/midi-menu/hell.mid";

    var music = null;
    var track = 0;
    var ver = navigator.appName;
    function audioCheck(plugName) {
    for (var i = 0; i < navigator.plugins.length; i++) {
    if (navigator.plugins[i].name.toLowerCase() == plugName.toLowerCase()) {
    for (var j = 0; j < navigator.plugins[i].length; j++) {
    if (navigator.plugins[i][j].enabledPlugin) {
    return true;
    }
    }
    return false;
    }
    }
    return false;
    }
    function chooseSong(s) { // ie
    track = s.options[s.selectedIndex].value;
    if (ver == "Microsoft Internet Explorer") {
    document.all.music.src = songNum[track];
    } else {
    songPlay('play');
    }
    }
    function songPlay(cmd) { // netscape
    if (audioCheck("LiveAudio")) {
    if (cmd == 'play') {
    document.musicSource.play(false, songNum[track]);
    }
    } else {
    alert("You Do Not Have The Correct Plugin");
    }
    }
    // End -->
    </script>
    </HEAD>

    <!-- STEP TWO: Copy this code into the BODY of your HTML document -->

    <BODY>

    <center>
    <form name=choose>
    <select size=1 name=track onChange="chooseSong(this);">
    <option value="0">Click For Music</option>
    <option value="1">Whiskey In A Jar</option>
    <option value="2">Aeroplane</option>
    <option value="3">Genie In A Bottle</option>
    <option value="4">Hell</option>
    </select>
    <input type=button onMouseDown="chooseSong(document.choose.track)" value=" Play ">
    </form>

    <script language="JavaScript">
    <!-- Begin
    var ver = navigator.appName;
    if (ver == "Microsoft Internet Explorer") {
    document.write('<bgsound src="#" ID=music loop=1 AUTOSTART=true>');
    } else {
    document.write('<embed type="audio/midi" src="aeroplane.mid" AUTOSTART=false hidden=true VOLUME="90" name="musicSource" MASTERSOUND></EMBED>');
    }
    // End -->
    </script>
    </center>

    <p><center>
    <font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
    by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
    </center><p>

    <!-- Script Size: 2.53 KB -->
    Last edited by HTML; 12-10-2002 at 09:46 AM.



Tags for this Thread