Avatar billede dj.iceman Nybegynder
03. april 2001 - 20:15 Der er 5 kommentarer og
1 løsning

MIDIPlayer

Er der nogen der har et script til en MIDI-afspiller??
Avatar billede imp Nybegynder
03. april 2001 - 20:55 #1
Du må lige skrive lidt mere om hvad det er du vil have! ... :)
Avatar billede cyfer Nybegynder
03. april 2001 - 21:08 #2
Er det dette du mener??

<embed width=\"128\" height=\"128\" src=\"file:///C:/WINDOWS/Skrivebord/film.mid\">
Avatar billede cyfer Nybegynder
03. april 2001 - 21:09 #3
<embed width=\"128\" height=\"128\" src=\"film.mid\">
Avatar billede dj.iceman Nybegynder
04. april 2001 - 19:52 #4
Det jeg gerne vil have, er at man har en såkaldt JukeBox, hvor man udfra den kan vælge imellem flere MIDI-filer...
Avatar billede cyfer Nybegynder
05. april 2001 - 14:01 #5
Måske denne kan bruges:::


<form name=\"midiForm\">
<select name=\"songPicked\" size=\"1\"
  onchange=\"midiPlay(this.options[selectedIndex].value)\">
    <option selected>Pick a Song</option>
    <option value=\"../midis/1812over.mid\">1812 Overture</option>
    <option value=\"../midis/3stooges.mid\">3 Stooges Overture</option>
    <option value=\"../midis/albundy.mid\">Love and Marriage</option>
    <option value=\"../midis/gilligan.mid\">Gilligan\'s Island</option>
    <option value=\"../midis/simpsons.mid\">The Simpsons</option>
    <option value=\"../midis/twinpeak.mid\">Twin Peaks</option>
    <option value=\"../midis/yesterday.mid\">Yesterday</option>
  </select>
</form>



<script language=\"javaScript\">
var jukeboxOpen = false
function midiPlay(song) {
if (jukeboxOpen==false) {
  winStats=\'toolbar=no,location=no,directories=no,status=no,menubar=no,\'
  winStats+=\'scrollbars=no,resizable=yes,\'
  if (navigator.appName.indexOf(\"Microsoft\")>=0) {
    winStats+=\'width=275,height=175,left=300,top=300\'
  }else{
    winStats+=\'width=300,height=200,screenX=300,screenY=300,alwaysRaised=yes\'
  }
  midiWindow = window.open (\"\",\"midiWindow\",winStats)
}
midiWindow.document.writeln (\"<html><head><title>Playing...</title>\")
midiWindow.document.writeln (\"</head>\")
midiWindow.document.writeln (\"<body>\")
midiWindow.document.writeln (\"<h2>MIDI Jukebox</h2>\")
midiWindow.document.writeln (\"<p>Give the MIDI a few seconds to download to your PC</p>\")
midiWindow.document.writeln (\"<br clear=\'all\'>\")
//-- Decide whether to use embed or bgsound.
if (navigator.appName.indexOf(\"Microsoft\")>=0) {
  midiWindow.document.writeln (\'<bgsound src=\"\'+song+\'\">\')
}else{
  midiWindow.document.writeln (\'<embed src=\"\'+song+\'\" hidden=true autostart=true>\')
}
midiWindow.document.writeln (\"<center><form>\")
midiWindow.document.writeln (\"<input type=\'button\' value=\'Close\' onClick=\'self.close()\'>\")
midiWindow.document.writeln (\"</form></center>\")
midiWindow.document.writeln (\"</body></html>\")
midiWindow.document.close()
jukeboxOpen=true
}
</script>
Avatar billede cyfer Nybegynder
05. april 2001 - 14:06 #6
Eller denne her::

Copy & Paste dette script ind i din HEAD tag:


<SCRIPT>

In the midiList array, use EXACT name of the MIDI file (with the .mid extension) that you would want to hear
In the titleList array, type the title of the coresponding song.

(The page containing this script MUST be in the directory which your songs are in, otherwise, specify a directory where your songs are located when editing the midiList array)

Example:
If you type: \"mysong.mid\" in the 4th column of the midiList array,
then you would type \"My Song\" in the 4th column of the titleList array.

*/

// Below, you can insert your MIDI songs and their titles into the jukebox.

midiList = new Array(\"\",\"song1.mid\",\"song2.mid\",\"song3.mid\");
titleList = new Array(\"\",\"Glycerine\",\"All I Have To Give\",\"When I Come Around\");

// Now, you choose the format for the way the title of the song is displayed

checkBold=0;     // Would you like the title Bolded? (1 = yes 0 = no)
checkItalic=1;      // Would you like the title in Italics? (1 = yes 0 = no)
checkUnder=0;      // Would you like the title Underlined? (1 = yes 0 = no)
fontColor=\'red\';     // Choose the color of your MIDI title (example: red, blue, black)
fontFace=\'Verdana\';  // Choose the font for your MIDI title (example: Verdana, Arial, Times New Roman)

// Do not touch anything below this tag.
// Variables are set

howMany = midiList.length-1;
date = new Date();
seed = date.getTime();
randomNumber = parseInt(((seed - (parseInt(seed/1000,10) * 1000))/10)/100*howMany
+ 1,10);

URL = location.href;
QUERY_POS = URL.indexOf(\"?\") + 1;
QUERY_STRING = URL.substring(QUERY_POS);
QUERY_POS-=1;
QUERY_POS2=QUERY_POS;
QUERY_POS2+=1;
if(QUERY_POS!=0) newLocation=URL.substring(0,QUERY_POS);
if(QUERY_POS2==0) newLocation=QUERY_STRING;
if(QUERY_STRING > 0) randomNumber=QUERY_STRING;

midi=midiList[randomNumber];
title=titleList[randomNumber];

if(!title){
midi=midiList[1];
title=titleList[1];
randomNumber=1;
}

window.defaultStatus=\"Now Playing... \"+randomNumber+\": \"+title;

if(document.layers) playMIDI = \'<EMBED SRC= \"\' + midi + \'\" WIDTH=200 HEIGHT=55 AUTOSTART=TRUE></EMBED><BR>\';
if(document.all) playMIDI = \'<BGSOUND SRC= \"\' + midi + \'\" loop=infinite AUTOSTART=TRUE></BGSOUND>\';

bold=(checkBold==1)?\"<B>\":\"\";
bold2=(checkBold==1)?\"</B>\":\"\";
italic=(checkItalic==1)?\"<I>\":\"\";
italic2=(checkItalic==1)?\"</I>\":\"\";
under=(checkUnder==1)?\"<U>\":\"\";
under2=(checkUnder==1)?\"</U>\":\"\";

function listMIDI(){
document.write(playMIDI);
for(x=0;x<=howMany;x++){
if(x==0)document.write(\"<B>Albums in Jukebox</B>:<BR>\");
if(x!=0 && x!=randomNumber)document.write(\"<font face=\"+fontFace+\"> \"+x+\" - \"+titleList[x]+\" (<A HREF=\"+newLocation+\"?\"+x+\">play</A>)</font><BR>\");
if(x==randomNumber)document.write(\"<font color=\\\"\"+fontColor+\"\\\" face=\"+fontFace+\">\"+bold+\"\"+italic+\"\"+under+\"\"+x+\" - \"+titleList[x]+\"\"+under2+\"\"+italic2+\"\"+bold2+\" - Now Playing...</font><BR>\");
}
}

//-->

</SCRIPT>



Copy & Paste scriptet der hvor din jukebox skal være:

<SCRIPT>
    listMIDI();
//-->
</SCRIPT>
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester