Current location: Hot Scripts Forums » General Web Coding » JavaScript » my radio only works on certain browsers... help!


my radio only works on certain browsers... help!

Reply
  #1 (permalink)  
Old 03-20-05, 07:28 PM
orang3 orang3 is offline
Newbie Coder
 
Join Date: Mar 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
my radio only works on certain browsers... help!

ok i have recently made a site and used this code for the radio... i have tested it out on many browsers and it only works on some. It works on IE, AOL, and SBC YAHOO browser. I found out that it doesnt work on MOZILLA and SAFARi. i havent tested out opera and other browsers. Im wondering how i can get it to work on other browsers (atleast mozilla). please help.

www.orange.vodka.at
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-20-05, 07:29 PM
orang3 orang3 is offline
Newbie Coder
 
Join Date: Mar 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
here is the current code

<OBJECT ID="Player" height="0" width="180" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<PARAM NAME="uiMode" VALUE="invisible">
<PARAM NAME="Autostart" VALUE="false">
</object>

<FORM ID="form">

<SELECT ID="playlist" size="1">
</center>

<center>
<!-- Add song info that appears in drop down list here -->
<option value="0">N. Mika-Yuki no Hana</option>
<option value="1">I-BomNal (O.S.T)</option>
<option value="2">Natalie-Goin` Crazy</option>
<option value="3">Simple Plan-Untitled</option>
<option value="4">50-God Gave Me Style</option>
<option value="5">Bleach Open Song</option>
<option value="6">Bleach End Song</option>
<option value="7">Mai Hime Open Song</option>
<option value="8">Mai Hime End Song</option>
</center>

</SELECT>
<center>
<BR>
<BUTTON ID="BackButton" onClick="Back(forms['form'].playlist);">&nbsp;<<&nbsp;</BUTTON>
<BUTTON ID="PlayPauseButton" onClick="PlayPause(forms['form'].playlist);"><FONT color="green">&nbsp;&nbsp;Play&nbsp;&nbsp;</FONT></BUTTON>
<BUTTON ID="NextButton" onClick="Next(forms['form'].playlist);">&nbsp;>>&nbsp;</BUTTON>&nbsp;
<BUTTON ID="StopButton" onclick="Stop();"><FONT color="maroon">Stop</FONT></BUTTON>
<b><font size="3" color="black">Shuffle</font></b><INPUT TYPE=checkbox CHECKED ID="ShuffleSwitch" onclick="ToggleShuffle(this);" value="ON">

</FORM>


</center>

<script ID="Main" Language="JavaScript">

var songs = new Array();

//*******************************//
//****** CHANGEABLE STUFF *******//
//*******************************//

var shuffle = false; // false = shuffle off, true = shuffle on

var autoStart = true; // false = autoStart off, true = autoStart on

var numberTracks = true; // true = place track number in front of list items, false = no track numbers

// Add song URLs here (make sure it matches up with the order you have for song info, and urls need quotes):
songs[0]="yuki.mp3";
songs[1]="bomnal.mp3";
songs[2]="natalie.mp3";
songs[3]="untitled.mp3";
songs[4]="style.mp3";
songs[5]="orange.mp3";
songs[6]="bleach.mp3";
songs[7]="mai.mp3";
songs[8]="hime.mp3";

//*******************************//
//*******************************//

// Initializations //
with (document){
var length = forms['form'].playlist.length;

if(numberTracks){
for (var i = 0; i < length; i++){
forms['form'].playlist.options[i].innerHTML = (i+1) + " - " + forms['form'].playlist.options[i].innerHTML;
}
}

if (shuffle) {
var randsg = Math.floor(Math.random()*songs.length);
Player.url = songs[randsg];
forms['form'].playlist.options[randsg].selected = true;
forms['form'].ShuffleSwitch.outerHTML = ShuffleOnHTML.innerHTML;
}

else {
forms['form'].ShuffleSwitch.outerHTML = ShuffleOffHTML.innerHTML;
Player.url = songs[0];
}

if(autoStart){
var snum = forms['form'].playlist.selectedIndex;
if(Player.url != songs[snum]){
Player.url = songs[snum];
}
Player.controls.Play();
}
}

// Functions //
// Discription: "PlayPause" will toggle playing and pausing if the same song is still selected,
// otherwise it will load the newly selected song
function PlayPause(list) {
var snum = list.selectedIndex;

if((Player.url == songs[snum] && Player.url != "") && Player.playState != 1){
if(Player.playState == 3){
Player.controls.Pause();
}

else {
Player.controls.Play();
}
}

else {
Player.url = songs[snum];
Player.controls.Play();
}
}

// Discription: "Next" will move to the next <span class='searchlite'>music</span> file if shuffle is off
// otherwise it will load a random song. Calls PlayPause to start <span class='searchlite'>music</span>.
function Next(list) {
var snum = list.selectedIndex;
if (!shuffle) {
if (snum == list.length-1) {
snum = -1;
}
snum++;
}

else {
var temp;
do{
temp = Math.floor(Math.random()*songs.length);
} while(temp == snum);
snum = temp;
}

list.options[snum].selected = true;
PlayPause(list);
}

// Discription: "Back" does the same thing as "Next" but moves backwads
// through the list. If shuffle is on then picks a random song.
function Back(list) {
var snum = list.selectedIndex;
if (!shuffle) {
if (snum == 0){
snum = list.length;
}
snum--;
}

else {
var temp;
do{
temp = Math.floor(Math.random()*songs.length);
} while(temp == snum);
snum = temp;
}

list.options[snum].selected = true;
PlayPause(list);
}

// Discription: Self explanitory.
function Stop(){
Player.controls.Stop();
}

// Discription: Makes the shuffle flag the same as the status of the CheckBox
// The status of the checkbox (true/false) indicates if the box is checked
function ToggleShuffle(CheckBox) {
shuffle = CheckBox.status;
}

</SCRIPT>

<script ID="StateChangeHandler" Language = "JavaScript" For = "Player" Event = playStateChange(NewState)>

// Description: This is an interupt handler used to handle instances when the
// state of the player changes to play or stop for example.

//STATE.innerText = NewState;

switch(NewState){
case 8: // Handles player after it just finishes playing through a song
var num = document.forms['form'].playlist.selectedIndex;

if (!shuffle){
if(num == document.forms['form'].playlist.length-1){
num = -1;
}

num++;
}
else {
var temp;
do{
temp = Math.floor(Math.random()*songs.length);
} while(temp == num);
num = temp;
}

document.forms['form'].playlist.options[num].selected = true;

PreviousState = NewState;
break;

case 1: // Handles player after it stops
if(PreviousState == 8){
var num = document.forms['form'].playlist.selectedIndex;
Player.settings.autoStart = true;
Player.url = songs[num];
PreviousState = NewState;
}

else if (PreviousState != 3 && PreviousState != 2){
Player.controls.Play();
Player.settings.autoStart = false;
}

else{
forms['form'].PlayPauseButton.innerHTML = PlayHTML.innerHTML;
}
break;

case 3: // Handles player after it starts to play
PreviousState = NewState;
forms['form'].PlayPauseButton.innerHTML = "Pause";
shuffle = document.forms['form'].ShuffleSwitch.status;
break;

case 2: // Handles player after being paused
PreviousState = NewState;
forms['form'].PlayPauseButton.innerHTML = PlayHTML.innerHTML;
break;

default:
}
</SCRIPT>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 01:44 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.