Go Back   CodingForums.com > :: Client side development > Graphics and Multimedia discussions

Before you post, read our: Rules & Posting Guidelines

Closed Thread
 
Thread Tools Rating: Thread Rating: 31 votes, 3.42 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-18-2005, 06:13 PM   PM User | #76
ogmium
New to the CF scene

 
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
ogmium is an unknown quantity at this point
if not random

Quote:
Originally Posted by _Aerospace_Eng_
Random after play time huh? This isn't easy, ... you would need to know the length of each song, because this length will be the deciding factor on when the function song() needs to run again. Look into the random function and how it is used. Also look into the setTimeout() in javascript.
If random isnt easy is it possible to start mediaplayer with a different video each time it starts up ie at a different place in a list? Whilst not random it produces the same effect if the list is long.
ogmium is offline  
Old 05-18-2005, 07:05 PM   PM User | #77
bluedoglov
New to the CF scene

 
Join Date: May 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
bluedoglov is an unknown quantity at this point
Quote:
Originally Posted by ogmium
If random isnt easy is it possible to start mediaplayer with a different video each time it starts up ie at a different place in a list? Whilst not random it produces the same effect if the list is long.
This code already picks a different song to play on start. I am looking for a different (random) song to be played after the first. Currently you have to pick a song after the first song is played.

Michele

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Random mp3 Music Player</title>
<style type="text/css">
<!--
#jukebox {
text-align:center;
}
-->
</style>
<script type="text/javascript">
<!--
nummp3 = 10
day = new Date()
z = day.getTime()
y = (z - (parseInt(z/1000,10) * 1000))/10
x = parseInt(y/100*nummp3,10) + 1
if (x == (1))
mp3=("song1.mp3")
if (x == (2))
mp3=("song2.mp3")
if (x == (3))
mp3=("song3.mp3")
if (x == (4))
mp3=("song4.mp3")
if (x == (5))
mp3=("song5.mp3")
if (x == (6))
mp3=("song6.mp3")
if (x == (7))
mp3=("song7.mp3")
if (x == (8))
mp3=("song8.mp3")
if (x == (9))
mp3=("song9.mp3")
if (x == (10))
mp3=("song10.mp3")
function song(){
document.getElementById('music1').innerHTML="<embed type='application/x-mplayer2' id='music2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' src='"+document.getElementById('cancion').value+"' name='MediaPlayer1' width='300' height='69' controltype='2' showcontrols='1' showstatusbar='1' AutoStart='true'></embed>";
}
//-->
</script>
</head>

<body>
<div id="jukebox">JUKEBOX<br><br>
<select  id="cancion" onchange="song()" size="1"> 
   <option value="none">::::::::::::: Choose Your Song Here :::::::::::::</option>
   <option value="http://song1.mp3">Song 1</option>
   <option value="http://song2.mp3">Song 2</option>
   <option value="http://song3.mp3">Song 3</option>
   <option value="http://song4.mp3">Song 4</option>
   <option value="http://song5.mp3">Song 5</option>	
   <option value="http://song6.mp3">Song 6</option>	
   <option value="http://song7.mp3">Song 7</option>	
   <option value="http://song8.mp3">Song 8</option>	
   <option value="http://song9.mp3">Song 9</option>
   <option value="http://song10.mp3">Song 10</option>	
</select><br><br>
<span id="music1">
<script type="text/javascript">
<!--
document.write('<embed type="application/x-mplayer2" '
+'pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" '
+'src="'+mp3+'" '
+'name="MediaPlayer1" '
+'width="300" '
+'height="69" '
+'controltype="2" '
+'showcontrols="1" '
+'showstatusbar="1" '
+'autostart="true">'
+'</embed>');
//-->
</script>
</span>
</div>
</body>
</html>

Last edited by bluedoglov; 05-20-2005 at 12:28 PM..
bluedoglov is offline  
Old 05-20-2005, 03:30 AM   PM User | #78
Stewball
New to the CF scene

 
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Stewball is an unknown quantity at this point
Random MP3Player

I have been reading this section and saw someone was asking about a random player. Below is the code for 2 pages i use on my private intranet and also have a link from my homepage so I can listen at work.

First I am by no means a programmer. A friend and I have been working on this on our lunch hours and have used public code we found on the internet and made some modifications.

I am sure there are much better ways to do this but this is working for me.

This random player will allow you to play a random file from a database. I have also included a song select page where you can search your mp3 files and list by artist and title.

I am working on adding a couple of features, first a play list that you build from the song select page and will be adding a random play by genre when I get all my mp3s tagged correctly.

Enjoy.....
Copy and paste this code into a webpage and name it wmp1.asp

Code:
<%@ LANGUAGE="VBScript" %>
<%response.buffer=true%>
<%
'*******************************************************************************************
' create a database titled readdrives.mdb and a table titled list2
' Access database format:
' vfile = actual path to song (e.g. http://www.domain.com/virtual drive/folder/song title.mp3)
' counter = number each song in the database (e.g. 1,2,3,... etc.) 
' artist = artist title (e.g. grateful_dead)
' title = song title without extension (e.g.truckin')
' title1 = song title with extension (e.g. truckin'.mp3)
' my songs are formated artist-song_title.mp3
' my mp3s are one a windows 2000 Pro box and my webserver is on a windows 2000 server box
' this is why I show the virtual path in the example
' modify to meet your needs
' This is the button I have on my homepage to start the player
' <form>
' <input type="button" 
' value="JeMP3Player" 
' onclick="openwindow3()">
' </form>
' This is the javascript I call up with the button
' <script type="text/javascript">
' function openwindow3()
' {
' window.open('http://www.yourdomain.net/wmp1.asp','JeMP3Player','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=350, height=175')
'}
'</script>
'*******************************************************************************************

Function ChkString(string)
	 if string = "" then string = " "
		string = Replace(string, chr(34), """")
	 string = trim(Replace(string, "'", "''"))
	 ChkString = string

End Function

vf1 = request.querystring("song")
va1 = request.querystring("artist")

RANDOMIZE

SET MY_CONN= SERVER.CREATEOBJECT("ADODB.Connection")
MYDSN="DRIVER={Microsoft Access Driver (*.mdb)};"
MYDSN=MYDSN & "DBQ=" &  "h:\mp3\mp3_uploads\readdrives.mdb" '<------be sure to change this
MY_CONN.OPEN MYDSN
SET RECORDSET = SERVER.CREATEOBJECT("ADODB.Recordset")
if request.querystring("song") <> "" then
vf1 = ChkString(request.querystring("song"))
SQL = "SELECT * FROM list2 where vfile = '" & vf1 & "'"
relode_flg = "false"
elseif request.querystring("artist") <> "" then
va1 = ChkString(request.querystring("artist"))
SQL = "SELECT * FROM list2 where artist = '" & va1 & "'"
relode_flg = "true"
else
relode_flg = "true"
SQL = "SELECT * FROM list2"
end if
RECORDSET.OPEN SQL, MY_CONN, 3,1
INTTOTALRECORDS = RECORDSET.RECORDCOUNT
if INTTOTALRECORDS > 1 then
RANDNO = INT(RND*INTTOTALRECORDS)
RECORDSET.MOVEFIRST
RECORDSET.MOVE RANDNO
end if

RandomLineItem = TRIM(RECORDSET("vfile"))
artist = trim(recordset("artist"))
title = trim(recordset("title"))
RECORDSET.CLOSE
SET RECORDSET = NOTHING
MY_CONN.CLOSE
SET MY_CONN = NOTHING
Song2Play = RandomLineItem
songname = artist & " - " & title
%>
<html>
<head>
<title>JeMP3Player</title>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<script language="JavaScript">
//Song title scroller
var behavior = "scroll" // can be alternate or slide
var direction = "left" // can be right, left , up or down
var ScrollDelay = 500; // speed of scroller


	function scrollMe(text,width,height)
	{
		document.write('<div style="border: thin inset rgb(225,225,225); font: 11px arial bold; width: '+width+'px; height: '+height+'px; background: #000000; color: #ffff99;" ><marquee behavior='+behavior+' direction='+direction+' scrolldelay='+ScrollDelay+'>'+text+'</marquee></div>');
	}

</script>

<script language="JavaScript">
var state;

//URL of song - Direct path
function playerinit()
{
player.url="<% = Song2Play %>";
player.settings.autoStart = true ;
}

// start the section if you want to use your own buttons

//Play Function
function play()
{
if (player.controls.isavailable('play'))
{
player.controls.play();
state=setInterval("updatetime()",1000);
playerinfo.innerHTML = "Play";
}
}

//Pause Function
function pause()
{
if (player.controls.isavailable('pause'))
{
player.controls.pause();
clearInterval(state);
playerinfo.innerHTML = "Paused";
}
}

//Stop Function
function stop()
{
if (player.controls.isavailable('stop'))
{
player.controls.stop();
clearInterval(state);
playerinfo.innerHTML = "Stopped";
}
}

//Step Function
function step()
{
if (player.controls.isavailable( 'step' ))
player.controls.step( 1 );
}

//Volume down function
function voldown()
{
if ( player.settings.volume < 5 )
{
player.settings.volume = 0;
playerinfo.innerHTML = "0";
}
else
{
player.settings.volume -= 20;
playerinfo.innerHTML = "Volume " + player.settings.volume +"%";
}
}

//Volume up function
function volup()
{
if ( player.settings.volume > 90 )
{
player.settings.volume = 10;
playerinfo.innerHTML = "Volume 50%";
}
else
{
player.settings.volume += 20;
playerinfo.innerHTML = "Volume " + player.settings.volume +"%";
}
}

//Mute Function
function mute()
{
player.settings.mute = !player.settings.mute;
playerinfo.innerHTML = "Mute";
}


//Fast Forward function (NOT USED - FIX)
function fastforward()
{
player.settings.rate = 2.0;
playerinfo.innerHTML = "Fastforwording";
}


//Rewind function (NOT USED - FIX)
function rewind()
{
player.settings.rate = -0.0;
playerinfo.innerHTML = "Rewinding";
}




//Balance Function
function balance()
{
switch (player.settings.balance)
{
case 0:
player.settings.balance = 100;
playerinfo.innerHTML = 'Balance: Right';
break;
case 100:
player.settings.balance = -100;
playerinfo.innerHTML = 'Balance: Left';
break;
case -100:
player.settings.balance = 0;
playerinfo.innerHTML = 'Balance: Center';
break;
default :
player.settings.balance = 0;
playerinfo.innerHTML = '???';
break;
}
}

//Time Function
function updatetime()
{
playerinfo.innerHTML = " <font color='#3A445C' size='1' face=verdana> " + player.controls.currentPositionString + " | " + player.currentMedia.durationString +" <font color='#3A445C' size='1' face=verdana>" + player.status + "</font>";
}

// end the use your own button section

</script>
</head>
<body bgcolor="#9BA4BF" text="#555555" link="#555555" alink="#555555" vlink="#555555"onload="playerinit();">

<!-- START PLAYER -->
<table width='100%' cellpadding=5 cellspacing=0 style='border: 0px solid #566494' >
<td>
<div align='center'>

<!-- Default Player Settings -->
<div id="layer1" style="position:absolute; left:0; width:0; height:0; top:0; visibility:visible;">
<table>
<tr>
<td>
</td>
</tr>
</table>
</div>
<!-- END Default Player Settings -->
<%
' my file format is artist-song_title.mp3 
songname = replace(songname,"_"," ")
%>

<!-- Title Scroller -->
<div id="layer1" style="position:absolute; left:25; width:150; height:10; top:10; visibility:visible;">
<table background='musicplayer_bg.gif' style="FILTER: alpha(opacity=90);" bgcolor='#9BA4BF' align='center' width='308' cellpadding=3 cellspacing=0 style='border: 1px solid #566494' >
<td>
<script>scrollMe("<%= SONGNAME %>",300,15);</script>
<!--<MARQUEE BEHAVIOR="slide" DIRECTION="left" SCROLLDELAY="1000" ALIGN="middle" WIDTH="100%"><font color='#0000C0' size='1' face=verdana><b><% = songname %></b></font></MARQUEE>-->
<br>
<br>
</td>
</table>
</div>
<!-- END Title Scroller -->


<!-- Player info & statistics -->
<div id="layer1" style="position:absolute; left:25; width:225; height:10; top:54; visibility:visible;">
<table bgcolor='#919BB9' style="FILTER: alpha(opacity=100);" bgcolor='#9BA4BF' align='center' width='308' cellpadding=3 cellspacing=0 style='border: 1px solid #566494' >
<td>
<font color='#3A445C' size='2' face=verdana><b> <span id="playerinfo"></span></b></font>
</td>
</table>
</div>
<!-- END Player info & statistics -->


<!-- Player Controls -->
<div id="layer4" style="position:absolute; left:25; width:300; height:10; top:73; visibility:visible;">
<table style="FILTER: alpha(opacity=100);"  bgcolor='#8A95B5' width='300' cellpadding=3 cellspacing=0 style='border: 1px solid #566494' >
<!-- bgcolor='#8A95B5' bgcolor='#9BA4BF' -->
<td align=center>
<object id="player" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject" width="300" height="42">
<param name="autoStart" value="true">
<param name="balance" value="0">
<param name="currentPosition" value="0">
<param name="currentMarker" value="0">
<param name="enableContextMenu" value="false">
<param name="enableErrorDialogs" value="false">
<param name="enabled" value="true">
<param name="fullScreen" value="false">
<param name="invokeURLs" value="false">
<param name="mute" value="false">
<param name="playCount" value="1">
<param name="rate" value="1">
<param name="uiMode" value="full">
<param name="volume" value="50">
<embed autostart="true" loop="false" width="200" height="30" controller="true" bgcolor="#FF9900" name="player"></embed></object> 
<!-- if you want to use your own buttons instead of the Windows Media Player controls
     you'll need to add your own buttons and possibly css file  
&nbsp; <input TYPE="image" src="volmax_button.gif" class="" onmouseover=""; onmouseout=""; value="" name="" onclick="location.reload(true);">
&nbsp; <input TYPE="image" src="play_button.gif" class="but21" onmouseover=this.className="but22"; onmouseout=this.className="but21"; value="Play " name="play" onclick="play();">
&nbsp; <input TYPE="image" src="stop_button.gif" class="but41" onmouseover=this.className="but42"; onmouseout=this.className="but41"; value="Stop" name="stop" onclick="stop();">
&nbsp; <input TYPE="image" src="pause_button.gif" class="but31" onmouseover=this.className="but32"; onmouseout=this.className="but31"; value="Pause" name="pause" onclick="pause();">
&nbsp; <input TYPE="image" src="mute_button.gif" class="but61" onmouseover=this.className="but62"; onmouseout=this.className="but61"; value="Mute" name="mute" onclick="mute();">
&nbsp; <input TYPE="image" src="bal_button.gif" class="but61" onmouseover=this.className="but62"; onmouseout=this.className="but61"; value="Balance" name="balance" onclick="balance();"> -->
<TABLE bgcolor='#8A95B5' align='center' width='100%'>
<TR>
<!-- You'll need to add small button gifs mine are 
.gif files 12 pix wide by 10 pix height
-->
<FORM action=wmp1.asp>
<TD bgcolor='#8A95B5' align=center><INPUT TYPE=IMAGE SRC="small_button.gif"></TD>
</FORM>
<TD bgcolor='#8A95B5' align=center><A href=# onclick="location.reload(true);"><IMG src="small_button.gif" border="0"></A></TD>
<TD bgcolor='#8A95B5' align=center><A href=songselect.asp target="_new" onClick="javascript:window.close();"><IMG src="small_button.gif" border="0"></A></TD>
<TD bgcolor='#8A95B5' align=center><A href=# onClick="javascript:window.close();"><IMG src="small_button.gif" border="0"></a></TD>
</TR><TR>
<TD bgcolor='#8A95B5' align=center><font color='#3A445C' size='1' face=verdana>Random<BR>Play</TD>
<TD bgcolor='#8A95B5' align=center><font color='#3A445C' size='1' face=verdana>Skip<BR>Song</TD>
<TD bgcolor='#8A95B5' align=center><font color='#3A445C' size='1' face=verdana>Select<BR>Song</TD>
<TD bgcolor='#8A95B5' align=center><font color='#3A445C' size='1' face=verdana>Close<BR>Player</TD>
</TR>
</TABLE>
<!--
more buttons for the volume if you want to use your own

</td>
<td width='52' bgcolor='#8A95B5' align=center>
<input TYPE="image" src="volmax_button.gif" class="" onmouseover=""; onmouseout=""; value="" name="" onclick="location.reload(true);">
&nbsp; <input TYPE="image" src="volmax_button.gif" class="but61" onmouseover=this.className="but62"; onmouseout=this.className="but61"; value="+" name="volup" onclick="volup();"><BR>
&nbsp; <input TYPE="image" src="volmin_button.gif" class="but61" onmouseover=this.className="but62"; onmouseout=this.className="but61"; value="-" name="voldown" onclick="voldown();">
<form action="wmp1.asp">
<button type="submit">Rand</button>
 -->
</td>
</table>
</div>
<!-- END Player Controls -->


<!-- Player New State -->
<script language = "JavaScript" for = player event = playstatechange(newstate)>
switch (newstate){
case 1:
playerinfo.innerHTML = "<font color='#3A445C' size='1' face=verdana>Loading..</font>";
break;
case 2:
playerinfo.innerHTML = "<font color='#3A445C' size='1' face=verdana>Loading...</font>";
break;
case 3:
playerinfo.innerHTML = "<font color='#3A445C' size='1' face=verdana>Loading....</font>";
{
player.controls.play();
state=setInterval("updatetime()",1000);
playerinfo.innerHTML = "<font color='#3A445C' size='1' face=verdana>Play</font>";
}
break;
case 10:
playerinfo.innerHTML = "<font color='#3A445C' size='2' face=verdana>Press play button to load song</font>";
case 8:
<% if relode_flg = "true" then%>
location.reload(true);
<% end if %>

break;
}
</script>
<!-- END Player New State -->
</body>

Be sure to read each file and make the necessary changes.

I have to post the songselect.asp webpage as a separate reply because of the length limits

Stewball
Stewball is offline  
Old 05-20-2005, 03:33 AM   PM User | #79
Stewball
New to the CF scene

 
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Stewball is an unknown quantity at this point
Part 2 of the random player

Copy and paste this code into a webpage and name it songselect.asp
Code:
<%
' ***************************************************************************
' This is the song select section webpage, it has the the same features as the player
' webpage. You'll need to make a few changes in here also.
' This page will display when you click the Song Select button on the player
' Because I am having problems passing variables from this page to the player
' webpage when you click the Song Select button on the player the player
' webpage will close and this one will open. 
' Using this webpage:
' If you click on the song title it will play just that single file. 
' If you click the artist then you will play all the songs you have by that artist 
' randomly. To return to Random mode click the random button on the player.
' ***************************************************************************



Function ChkString(string)
	 if string = "" then string = " "
		string = Replace(string, chr(34), "\""")
	 string = trim(Replace(string, "'", "\'"))
	 ChkString = string

End Function



set my_conn= Server.CreateObject("ADODB.Connection")
myDSN="DRIVER={Microsoft Access Driver (*.mdb)};"
myDSN=myDSN & "DBQ=" &  "H:\mp3\mp3_uploads\readdrives.mdb" ' <-----change this
my_conn.Open myDSN
if Request.QueryString("B1") = "Search" then
Set recordset = Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM list2"
recordset.Open sql, my_conn, 3,1
intTotalRecords = recordset.RecordCount
recordset.Movefirst



If Request.QueryString("TypeSearch") = "FirstName" Then
if Request.QueryString("DaInBox2") <> "" then 	
sql = sql & " WHERE artist LIKE '%" & _
Request.QueryString("DaInBox2") & "%'  order by artist asc, title asc"
End If
if Request.QueryString("DaInBox") <> "" then 	
sql = sql & " WHERE artist LIKE '" & _
Request.QueryString("DaInBox") & "%'  order by artist asc, title asc"
End If
End if

If Request.QueryString("TypeSearch") = "LastName" Then
if Request.QueryString("DaInBox2") <> "" then 	
sql = sql & " WHERE title LIKE '%" & _
Request.QueryString("DaInBox2") & "%' order by title asc, artist asc"
End If
if Request.QueryString("DaInBox") <> ""  then 	
sql = sql & " WHERE title LIKE '" & _
Request.QueryString("DaInBox") & "%' order by title asc, artist asc"
End If
End If

set rsSQL = Server.CreateObject("ADODB.Recordset")
rsSQL.open sql, my_conn
end if 



%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
    <TITLE>Song Selection</TITLE>
    <META NAME="GENERATOR" CONTENT="WebPad Pro">
<script type="text/javascript">
// this script is currently not being used
function changeURL(winName, newURL) {
win = window.open(newURL, winName,'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=350, height=175');
win.location.href = newURL;
}

</script>



<script type="text/javascript">
function openwindow3(winName, newURL) {
  win = window.open(newURL, winName,'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=350, height=175');
  win.location.href = newURL;
}
</script>

</HEAD>

<BODY BGCOLOR="#FFFFFF">
<FONT face=arial size=3 color=#000000>
<CENTER>
<P><B>Welcome to the JeMP3Player Select Song webpage.</B> 

<P><IMG src=JeMP3Player.jpg> <!-- Here I have a picture of the player -->

<FONT face=arial size=2 color=#000000>

</CENTER>
<P>You have several choices listed below:
<BR>
<BR>

<TABLE width=75%>
<TR>

<TD valign=top><FONT face=arial size=2 color=#000000><B>Play Songs from a Given Artist Randomly</B></TD>
<TD valign=top><FONT face=arial size=2 color=#000000>Select the letter of the Artist from the list below 
 and when the list appears click their name under the Artist column and just those from the 
 selected artist will play Randomly.<BR><BR></td>
</TR><TR>
<td valign=top><FONT face=arial size=2 color=#000000><B>Play Select Song</B></TD>
<TD valign=top><FONT face=arial size=2 color=#000000>Select the letter of the Title from the list below 
of a song and when the list appears click on he song title under the Title column and just the 
selected song will play.<BR><BR></td>
</TR><TR>
<TD valign=top><FONT face=arial size=2 color=#000000><B>Play List Feature</B></TD>
<TD valign=top><FONT face=arial size=2 color=#000000>Currently under construction.<BR><BR></td>
</TR><TR>
<td valign=top><FONT face=arial size=2 color=#000000><B>Return to Random Play</B></TD>
<TD valign=top><FONT face=arial size=2 color=#000000>Click the Random button on the player to 
return to random mode at any time.<BR><BR></td>
</TABLE>
<CENTER>

</CENTER>
<!--artist-->
<P><FONT face=arial size=3 color=#000000><B>Select a song by Artist First Name</B></P>
<FONT face=arial size=2 color=#000000><P>Click on a letter to see all songs where the artist name begins with the letter selected. When you click on the Artist Name you will play randomly all the songs we have by that artist.<FONT face=arial size=1 color=#000000>(example: Grateful Dead, or Jerry Garcia, or Jerry)</P>
<FONT face=arial size=2 color=#000000>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=a&B1=Search" >A</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=b&B1=Search" >B</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=c&B1=Search" >C</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=d&B1=Search" >D</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=e&B1=Search" >E</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=f&B1=Search" >F</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=g&B1=Search" >G</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=h&B1=Search" >H</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=i&B1=Search" >I</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=j&B1=Search" >J</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=k&B1=Search" >K</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=l&B1=Search" >L</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=m&B1=Search" >M</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=n&B1=Search" >N</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=o&B1=Search" >O</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=p&B1=Search" >P</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=q&B1=Search" >Q</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=r&B1=Search" >R</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=s&B1=Search" >S</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=t&B1=Search" >T</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=u&B1=Search" >U</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=v&B1=Search" >V</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=w&B1=Search" >W</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=x&B1=Search" >X</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=y&B1=Search" >Y</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=&B1=Search"  >Z</A>&nbsp;&nbsp;
<!--title-->
<P><HR ALIGN="left" WIDTH="75%" COLOR="#000000">
<P><FONT face=arial size=3 color=#000000><B>Select a song by the Song Title</B></P>
<FONT face=arial size=2 color=#000000><P>Click on a letter to see all songs where the title of the song begins with the letter selected. <FONT face=arial size=1 color=#000000>(example: Truckin)</P>
<FONT face=arial size=2 color=#000000>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=a&B1=Search" >A</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=b&B1=Search" >B</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=c&B1=Search" >C</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=d&B1=Search" >D</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=e&B1=Search" >E</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=f&B1=Search" >F</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=g&B1=Search" >G</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=h&B1=Search" >H</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=i&B1=Search" >I</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=j&B1=Search" >J</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=k&B1=Search" >K</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=l&B1=Search" >L</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=m&B1=Search" >M</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=n&B1=Search" >N</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=o&B1=Search" >O</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=p&B1=Search" >P</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=q&B1=Search" >Q</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=r&B1=Search" >R</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=s&B1=Search" >S</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=t&B1=Search" >T</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=u&B1=Search" >U</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=v&B1=Search" >V</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=w&B1=Search" >W</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=x&B1=Search" >X</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=y&B1=Search" >Y</A>&nbsp;&nbsp;
<A href="songselect.asp?TypeSearch=LastName&DaInBox=&B1=Search"  >Z</A>&nbsp;&nbsp;

<P><font face="arial,helvetica" color="#000000" size="3"><B>Search our Song Database</B>
<font face="arial,helvetica" color="#000000" size="2">
<P>If you would rather search for an artist name, song title or part of a artist name or song title, use the search box below:</P>

    <font face="arial,helvetica" color="#000000" size="2">
    <OL type="1" start="1">
    <LI>Select Artist or Title<BR></LI>
    <LI>Type Search Criteria<BR></LI>
    <LI>Click Search button<BR><BR></LI>
    </OL>
    </center>
    <form action="songselect.asp" method="get" name="DaForm" align="center">
    <select name="TypeSearch" size="1">
    <option selected value="FirstName">Artist Name</option>
    <option value="LastName">Song Name </option>
    </select>
    <input type="text" size="20" name="DaInBox2">
    <input type="submit" name="B1" value="Search"><input type="reset" name="B2" value="Clear">
    </form>
<% if Request.QueryString("B1") = "Search" then

If Not rsSQL.BOF Then %> 
<table BORDER="0" cellpadding="3" cellspacing="8">
  <tr>
    <td bgcolor="#3366cc"><font face="Arial" color="#FFFFFF">Artist Name </font></td>
    <td bgcolor="#3366cc"><font face="Arial" color="#FFFFFF">Song Title </font></td>
  </tr>
<%
counter = 0
Do While Not rsSQL.EOF
artist = rsSQL("artist")
artist =replace(artist, "_", " ")
title = rsSQL("title")
title = replace(title, "_", " ")
song = ChkString(rsSQL("vfile"))
song2 = "http://www.yourdomain.net/mp3-1/website/wmp1.asp?song=" & song	'<---------change this
song3 = "'JeMP3Player' , " & "'" & song2 & "'"
song4 = "http://www.yourdomain.net/mp3-1/website/wmp1.asp?artist=" & ChkString(rsSQL("artist")) '<--------------change this
song5 = "'JeMP3Player' , " & "'" & song4 & "'"
'response.write("song3 = " & song3 & "<BR>")
%>


<% IF COUNTER = 0 THEN %>
<tr>
<td bgcolor="#FFFFCC"><A href="songselect.asp?TypeSearch=<% = Request.QueryString("TypeSearch") %>&DaInBox=<% = Request.QueryString("DaInBox") %>&B1=<% = Request.QueryString("B1") %>" onclick="openwindow3(<% = song5 %>)"><%=artist%></A></TD>
<TD bgcolor="#EFEFEF"><A href="songselect.asp?TypeSearch=<% = Request.QueryString("TypeSearch") %>&DaInBox=<% = Request.QueryString("DaInBox") %>&B1=<% = Request.QueryString("B1") %>" onclick="openwindow3(<% = song3 %>)"><%=title%></A></td>
</td>
<% counter = counter + 1
END IF %>    

<% IF COUNTER = 1 THEN %>
<tr>
<td bgcolor="#EFEFEF"><A href="songselect.asp?TypeSearch=<% = Request.QueryString("TypeSearch") %>&DaInBox=<% = Request.QueryString("DaInBox") %>&B1=<% = Request.QueryString("B1") %>" onclick="openwindow3(<% = song5 %>)"><%=artist%></A></TD>
<TD bgcolor="#EFEFEF"><A href="songselect.asp?TypeSearch=<% = Request.QueryString("TypeSearch") %>&DaInBox=<% = Request.QueryString("DaInBox") %>&B1=<% = Request.QueryString("B1") %>" onclick="openwindow3(<% = song3 %>)"><%=title%></A></td>
</td>
<% counter = 0
END IF %>  
                   
  </tr>
<% rsSQL.MoveNext
	Loop
End If
%>
<%If rsSQL.BOF and rsSQL.EOF Then%>
<TR>
<TD>
<h2 align="center"><font face="arial,helvetica" color="#000080" size="3">We did not find a match for your search</h2>
</TD>
</TR>
</table>
<%End If
rsSQL.Close
End if 
my_conn.Close
%>
</TR>
</table>

</BODY>
</HTML>
Stewball is offline  
Old 05-20-2005, 04:47 AM   PM User | #80
rrldance
New to the CF scene

 
Join Date: May 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
rrldance is an unknown quantity at this point
Question I need help

I am so confused trying to catch up with this whole thing...but basically I need to have my embedded mp3 player, play continuous music as different pages are being clicked on the website I am working on it. I have the basic coding and don't write html.....can anyone help.
rrldance is offline  
Old 05-20-2005, 05:33 AM   PM User | #81
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Thats not going to happen using only one page, you are going to need to use frames or iframes. www.w3schools.com is a good place to learn. seems like you are taking on more than your plate can handle. Learn the html first then move on to the more advanced multimedia stuff.
_Aerospace_Eng_ is offline  
Old 05-20-2005, 12:28 PM   PM User | #82
bluedoglov
New to the CF scene

 
Join Date: May 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
bluedoglov is an unknown quantity at this point
Quote:
Originally Posted by Stewball
I have been reading this section and saw someone was asking about a random player. Below is the code for 2 pages i use on my private intranet and also have a link from my homepage so I can listen at work.

First I am by no means a programmer. A friend and I have been working on this on our lunch hours and have used public code we found on the internet and made some modifications.

I am sure there are much better ways to do this but this is working for me.

This random player will allow you to play a random file from a database. I have also included a song select page where you can search your mp3 files and list by artist and title.

I am working on adding a couple of features, first a play list that you build from the song select page and will be adding a random play by genre when I get all my mp3s tagged correctly.

Enjoy.....
Copy and paste this code into a webpage and name it wmp1.asp


Be sure to read each file and make the necessary changes.

I have to post the songselect.asp webpage as a separate reply because of the length limits

Stewball

Thanks but I am looking for the embedded media player to play random songs and not one that will play in another window. Since my page has frames they can listen to the songs no matter what page they are at.

Thanks,

Michele
bluedoglov is offline  
Old 05-20-2005, 03:50 PM   PM User | #83
Toxic_2
New to the CF scene

 
Join Date: May 2005
Location: Toronto
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Toxic_2 is an unknown quantity at this point
This is perfect for my website but why doesn't it play when i click on the individual songs what am i missing

Quote:
Originally Posted by _Aerospace_Eng_
Code:
<div align=center> 
<SELECT id=cancion onchange=document.all.music.filename=document.all.cancion.value; size=1 name=Music> 
   <OPTION selected>::::::::::::: Choose Your Song Here :::::::::::::</OPTION>        
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 

         </SELECT><BR> 
<OBJECT id=music height=44 width=230 classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95> 
   <PARAM NAME="AutoStart" VALUE="-1"> 
   <PARAM NAME="Balance" VALUE="0"> 
   <PARAM NAME="DisplaySize" VALUE="0"> 
   <PARAM NAME="Filename" VALUE=""> 
   <PARAM NAME="Mute" VALUE="0"> 
   <PARAM NAME="SelectionStart" VALUE="-1"> 
   <PARAM NAME="SelectionEnd" VALUE="-1"> 
   <PARAM NAME="ShowControls" VALUE="-1"> 
   <PARAM NAME="ShowAudioControls" VALUE="-1"> 
   <PARAM NAME="ShowDisplay" VALUE="0"> 
   <PARAM NAME="ShowPositionControls" VALUE="-1"> 
   <PARAM NAME="Volume" VALUE="0"> 
   <PARAM NAME="AudioStream" VALUE="-1"> 
   <PARAM NAME="AutoSize" VALUE="0"> 
   <PARAM NAME="AnimationAtStart" VALUE="-1"> 
   <PARAM NAME="AllowScan" VALUE="-1"> 
   <PARAM NAME="AllowChangeDisplaySize" VALUE="-1"> 
   <PARAM NAME="AutoRewind" VALUE="1"> 
   <PARAM NAME="BaseURL" VALUE=""> 
   <PARAM NAME="BufferingTime" VALUE="5"> 
   <PARAM NAME="CaptioningID" VALUE=""> 
   <PARAM NAME="ClickToPlay" VALUE="-1"> 
   <PARAM NAME="CursorType" VALUE="0"> 
   <PARAM NAME="CurrentPosition" VALUE="-1"> 
   <PARAM NAME="CurrentMarker" VALUE="0"> 
   <PARAM NAME="DefaultFrame" VALUE=""> 
   <PARAM NAME="DisplayBackColor" VALUE="0"> 
   <PARAM NAME="DisplayForeColor" VALUE="16777215"> 
   <PARAM NAME="DisplayMode" VALUE="0"> 
   <PARAM NAME="Enabled" VALUE="-1"> 
   <PARAM NAME="EnableContextMenu" VALUE="-1"> 
   <PARAM NAME="EnablePositionControls" VALUE="-1"> 
   <PARAM NAME="EnableFullScreenControls" VALUE="0"> 
   <PARAM NAME="EnableTracker" VALUE="-1"> 
   <PARAM NAME="InvokeURLs" VALUE="-1"> 
   <PARAM NAME="Language" VALUE="-1"> 
   <PARAM NAME="PlayCount" VALUE="1"> 
   <PARAM NAME="PreviewMode" VALUE="0"> 
   <PARAM NAME="Rate" VALUE="1"> 
   <PARAM NAME="SAMILang" VALUE=""> 
   <PARAM NAME="SAMIStyle" VALUE=""> 
   <PARAM NAME="SAMIFileName" VALUE=""> 
   <PARAM NAME="SendOpenStateChangeEvents" VALUE="-1"> 
   <PARAM NAME="SendWarningEvents" VALUE="-1"> 
   <PARAM NAME="SendErrorEvents" VALUE="-1"> 
   <PARAM NAME="SendKeyboardEvents" VALUE="0"> 
   <PARAM NAME="SendMouseClickEvents" VALUE="0"> 
   <PARAM NAME="SendMouseMoveEvents" VALUE="0"> 
   <PARAM NAME="SendPlayStateChangeEvents" VALUE="-1"> 
   <PARAM NAME="ShowCaptioning" VALUE="0"> 
   <PARAM NAME="ShowGotoBar" VALUE=0"> 
   <PARAM NAME="ShowStatusBar" VALUE="0"> 
   <PARAM NAME="ShowTracker" VALUE="-1"> 
   <PARAM NAME="TransparentAtStart" VALUE="-1"> 
   <PARAM NAME="VideoBorderWidth" VALUE="0"> 
   <PARAM NAME="VideoBorderColor" VALUE="0"> 
   <PARAM NAME="VideoBorder3D" VALUE="0"> 
   <PARAM NAME="WindowlessVideo" VALUE="0"> 
</OBJECT> 
</div>
windows media player may be IE only though
Toxic_2 is offline  
Old 05-20-2005, 07:39 PM   PM User | #84
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Try this one instead
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript"><!--
function song(){
document.getElementById('music1').innerHTML="<embed type='application/x-mplayer2' id='music2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' src='"+document.getElementById('cancion').value+"' name='MediaPlayer1' width='300' height='75' controltype='2' showcontrols='1' showstatusbar='1' AutoStart='true'></embed>";
}
//-->
</script>
</head>
<body>
<select  id="cancion" onchange="song()" size="1"> 
   <option value="none">::::::::::::: Choose Your Song Here :::::::::::::</option>
   <option value="http://urltosong1.mp3">Song 1</option>
   <option value="http://urltosong2.mp3">Song 2</option>
   <option value="http://urltosong3.mp3">Song 3</option>
   <option value="http://urltosong4.mp3">Song 4</option>
   <option value="http://urltosong5.mp3">Song 5</option>	
</select><br> 
<span id="music1"><embed type="application/x-mplayer2" id="music1"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" 
src="" 
name="MediaPlayer1" 
width="300"
height="70"
controltype="2" 
showcontrols="1"
showstatusbar="1"
AutoStart="0">
</embed></span>
</div>
</body>
</html>
Its not as bulky, and it should work in other browsers as well. Also the option values might have to be exact urls or it might not work properly, at least this is what I discovered after testing.
_Aerospace_Eng_ is offline  
Old 05-21-2005, 01:42 PM   PM User | #85
Toxic_2
New to the CF scene

 
Join Date: May 2005
Location: Toronto
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Toxic_2 is an unknown quantity at this point
Thanks so much it works perfectly,you guys are amazing


Quote:
Originally Posted by _Aerospace_Eng_
Try this one instead
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript"><!--
function song(){
document.getElementById('music1').innerHTML="<embed type='application/x-mplayer2' id='music2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' src='"+document.getElementById('cancion').value+"' name='MediaPlayer1' width='300' height='75' controltype='2' showcontrols='1' showstatusbar='1' AutoStart='true'></embed>";
}
//-->
</script>
</head>
<body>
<select  id="cancion" onchange="song()" size="1"> 
   <option value="none">::::::::::::: Choose Your Song Here :::::::::::::</option>
   <option value="http://urltosong1.mp3">Song 1</option>
   <option value="http://urltosong2.mp3">Song 2</option>
   <option value="http://urltosong3.mp3">Song 3</option>
   <option value="http://urltosong4.mp3">Song 4</option>
   <option value="http://urltosong5.mp3">Song 5</option>	
</select><br> 
<span id="music1"><embed type="application/x-mplayer2" id="music1"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" 
src="" 
name="MediaPlayer1" 
width="300"
height="70"
controltype="2" 
showcontrols="1"
showstatusbar="1"
AutoStart="0">
</embed></span>
</div>
</body>
</html>
Its not as bulky, and it should work in other browsers as well. Also the option values might have to be exact urls or it might not work properly, at least this is what I discovered after testing.
Toxic_2 is offline  
Old 05-31-2005, 05:06 PM   PM User | #86
websnow
New to the CF scene

 
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
websnow is an unknown quantity at this point
This code is the best

My questions :

1. how to make automatic play song1 on page load ?
2. how to make this script play song automatic.. start play from song1 --> song2 ---> song 3... automaticly like play list



Quote:
Originally Posted by _Aerospace_Eng_
you almost had it, u need to use onclick for this one
Code:
<div align=center> 
<OBJECT id=music height=44 width=230 classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95> 
<param name="AudioStream" value="-1">
<param name="AutoSize" value="0">
<param name="AutoStart" value="-1">
<param name="AnimationAtStart" value="-1">
<param name="AllowScan" value="-1">
<param name="AllowChangeDisplaySize" value="-1">
<param name="AutoRewind" value="-1">
<param name="Balance" value="0">
<param name="BaseURL" value>
<param name="BufferingTime" value="5">
<param name="CaptioningID" value>
<param name="ClickToPlay" value="-1">
<param name="CursorType" value="0">
<param name="CurrentPosition" value="-1">
<param name="CurrentMarker" value="0">
<param name="DefaultFrame" value>
<param name="DisplayBackColor" value="0">
<param name="DisplayForeColor" value="16777215">
<param name="DisplayMode" value="0">
<param name="DisplaySize" value="0">
<param name="Enabled" value="-1">
<param name="EnableContextMenu" value="-1">
<param name="EnablePositionControls" value="-1">
<param name="EnableFullScreenControls" value="0">
<param name="EnableTracker" value="-1">
<param name="Filename" value>
<param name="InvokeURLs" value="-1">
<param name="Language" value="-1">
<param name="Mute" value="0">
<param name="PlayCount" value="1">
<param name="PreviewMode" value="0">
<param name="Rate" value="1">
<param name="SAMILang" value>
<param name="SAMIStyle" value>
<param name="SAMIFileName" value>
<param name="SelectionStart" value="-1">
<param name="SelectionEnd" value="-1">
<param name="SendOpenStateChangeEvents" value="-1">
<param name="SendWarningEvents" value="-1">
<param name="SendErrorEvents" value="-1">
<param name="SendKeyboardEvents" value="0">
<param name="SendMouseClickEvents" value="0">
<param name="SendMouseMoveEvents" value="0">
<param name="SendPlayStateChangeEvents" value="-1">
<param name="ShowCaptioning" value="0">
<param name="ShowControls" value="-1">
<param name="ShowAudioControls" value="-1">
<param name="ShowDisplay" value="0">
<param name="ShowGotoBar" value="0">
<param name="ShowPositionControls" value="-1">
<param name="ShowStatusBar" value="0">
<param name="ShowTracker" value="-1">
<param name="TransparentAtStart" value="-1">
<param name="VideoBorderWidth" value="0">
<param name="VideoBorderColor" value="0">
<param name="VideoBorder3D" value="0">
<param name="Volume" value="0">
<param name="WindowlessVideo" value="0"> 
</OBJECT> 
</div>
<p> 
<INPUT id=song1 onclick=document.all.music.filename=document.all.song1.value; TYPE="RADIO" NAME="Music" VALUE="song1.m3u">Song 1
</p>
<p><INPUT id=song2 onclick=document.all.music.filename=document.all.song2.value; TYPE="RADIO" NAME="Music" VALUE="song2.m3u">Song 2
</p>
<p>
<INPUT id=song3 onclick=document.all.music.filename=document.all.song3.value; TYPE="RADIO" NAME="Music" VALUE="song3.m3u">Song 3</p>
websnow is offline  
Old 05-31-2005, 05:19 PM   PM User | #87
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
So you aren't going to want to use the drop down menu correct, but you are going to want to allow the users to skip back and forth to other songs right? It sounds like you want a playlist, read the last post on this page and follow the link there to find out how to make an m3u playlist. Then you can just use the following code which is far less bulkier than the version you found.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<meta http-equiv="Content-Type" 
content="text/html; charset=iso-8859-1"> 
<title>Untitled Document</title>
<style type="text/css"> 
<!-- 
body {
text-align:center;
}
--> 
</style> 
</head>
<body>
<object id="mediaPlayer" width="270" height="45" 
      classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" 
      codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
      standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
      <param name="fileName" value="http://url-to-your-playerlist.m3u">
      <param name="animationatStart" value="true">
      <param name="transparentatStart" value="true">
      <param name="autoStart" value="true">
      <param name="showControls" value="true">
      <param name="loop" value="true">
      <embed type="application/x-mplayer2" 
      pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" 
      bgcolor="darkblue" showcontrols="true" width="270" height="45" 
      src="http://url-to-your-playerlist.m3u" autostart="true" designtimesp="5311" loop="true">
</object>
</body>
</html>
You will want to change the filename value to match your playlist location, and you will also want to change the src in the embed tag to match your playlist location. Autostart is set to true so it should start playing onload.
_Aerospace_Eng_ is offline  
Old 05-31-2005, 05:56 PM   PM User | #88
websnow
New to the CF scene

 
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
websnow is an unknown quantity at this point
HI Aerospace_Eng
Thank you for code

i know how to use play list (ASX)
but i have some reason that canot use asx and mu3 playlist

are there anyway to make java script
onload and play song from start from 1234567 ?
and user can select song to start to play from?
ie..start to play from song 2-3-4-5-6-7
or song 5-6-7

---


---

Quote:
Originally Posted by _Aerospace_Eng_
So you aren't going to want to use the drop down menu correct, but you are going to want to allow the users to skip back and forth to other songs right? It sounds like you want a playlist, read the last post on this page and follow the link there to find out how to make an m3u playlist. Then you can just use the following code which is far less bulkier than the version you found.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<meta http-equiv="Content-Type" 
content="text/html; charset=iso-8859-1"> 
<title>Untitled Document</title>
<style type="text/css"> 
<!-- 
body {
text-align:center;
}
--> 
</style> 
</head>
<body>
<object id="mediaPlayer" width="270" height="45" 
      classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" 
      codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
      standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
      <param name="fileName" value="http://url-to-your-playerlist.m3u">
      <param name="animationatStart" value="true">
      <param name="transparentatStart" value="true">
      <param name="autoStart" value="true">
      <param name="showControls" value="true">
      <param name="loop" value="true">
      <embed type="application/x-mplayer2" 
      pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" 
      bgcolor="darkblue" showcontrols="true" width="270" height="45" 
      src="http://url-to-your-playerlist.m3u" autostart="true" designtimesp="5311" loop="true">
</object>
</body>
</html>
You will want to change the filename value to match your playlist location, and you will also want to change the src in the embed tag to match your playlist location. Autostart is set to true so it should start playing onload.
websnow is offline  
Old 05-31-2005, 06:01 PM   PM User | #89
websnow
New to the CF scene

 
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
websnow is an unknown quantity at this point
disadvantage of playlist :
ie...

if in playlist has 100 songs
if user want to play song number 50 they have to click next button 49 times
take long time to get song number 50.

-----------------

but if use your java scripts code
user can just click or tick radio button at song50 just one time
it's fast access to song number 50
and will automatic play from song 50 -song 100

Last edited by websnow; 05-31-2005 at 06:03 PM..
websnow is offline  
Old 05-31-2005, 07:49 PM   PM User | #90
AprilZan
New to the CF scene

 
Join Date: May 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
AprilZan is an unknown quantity at this point
Question

"
Quote:
Originally Posted by _Aerospace_Eng_
Code:
<div align=center> 
<SELECT id=cancion onchange=document.all.music.filename=document.all.cancion.value; size=1 name=Music> 
   <OPTION selected>::::::::::::: Choose Your Song Here :::::::::::::</OPTION>        
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 
      <OPTION value=http://urltoyoursong.mp3>Artist - Song Title</OPTION> 

         </SELECT><BR> 
<OBJECT id=music height=44 width=230 classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95> 
   <PARAM NAME="AutoStart" VALUE="-1"> 
   <PARAM NAME="Balance" VALUE="0"> 
   <PARAM NAME="DisplaySize" VALUE="0"> 
   <PARAM NAME="Filename" VALUE=""> 
   <PARAM NAME="Mute" VALUE="0"> 
   <PARAM NAME="SelectionStart" VALUE="-1"> 
   <PARAM NAME="SelectionEnd" VALUE="-1"> 
   <PARAM NAME="ShowControls" VALUE="-1"> 
   <PARAM NAME="ShowAudioControls" VALUE="-1"> 
   <PARAM NAME="ShowDisplay" VALUE="0"> 
   <PARAM NAME="ShowPositionControls" VALUE="-1"> 
   <PARAM NAME="Volume" VALUE="0"> 
   <PARAM NAME="AudioStream" VALUE="-1"> 
   <PARAM NAME="AutoSize" VALUE="0"> 
   <PARAM NAME="AnimationAtStart" VALUE="-1"> 
   <PARAM NAME="AllowScan" VALUE="-1"> 
   <PARAM NAME="AllowChangeDisplaySize" VALUE="-1"> 
   <PARAM NAME="AutoRewind" VALUE="1"> 
   <PARAM NAME="BaseURL" VALUE=""> 
   <PARAM NAME="BufferingTime" VALUE="5"> 
   <PARAM NAME="CaptioningID" VALUE=""> 
   <PARAM NAME="ClickToPlay" VALUE="-1"> 
   <PARAM NAME="CursorType" VALUE="0"> 
   <PARAM NAME="CurrentPosition" VALUE="-1"> 
   <PARAM NAME="CurrentMarker" VALUE="0"> 
   <PARAM NAME="DefaultFrame" VALUE=""> 
   <PARAM NAME="DisplayBackColor" VALUE="0"> 
   <PARAM NAME="DisplayForeColor" VALUE="16777215"> 
   <PARAM NAME="DisplayMode" VALUE="0"> 
   <PARAM NAME="Enabled" VALUE="-1"> 
   <PARAM NAME="EnableContextMenu" VALUE="-1"> 
   <PARAM NAME="EnablePositionControls" VALUE="-1"> 
   <PARAM NAME="EnableFullScreenControls" VALUE="0"> 
   <PARAM NAME="EnableTracker" VALUE="-1"> 
   <PARAM NAME="InvokeURLs" VALUE="-1"> 
   <PARAM NAME="Language" VALUE="-1"> 
   <PARAM NAME="PlayCount" VALUE="1"> 
   <PARAM NAME="PreviewMode" VALUE="0"> 
   <PARAM NAME="Rate" VALUE="1"> 
   <PARAM NAME="SAMILang" VALUE=""> 
   <PARAM NAME="SAMIStyle" VALUE=""> 
   <PARAM NAME="SAMIFileName" VALUE=""> 
   <PARAM NAME="SendOpenStateChangeEvents" VALUE="-1"> 
   <PARAM NAME="SendWarningEvents" VALUE="-1"> 
   <PARAM NAME="SendErrorEvents" VALUE="-1"> 
   <PARAM NAME="SendKeyboardEvents" VALUE="0"> 
   <PARAM NAME="SendMouseClickEvents" VALUE="0"> 
   <PARAM NAME="SendMouseMoveEvents" VALUE="0"> 
   <PARAM NAME="SendPlayStateChangeEvents" VALUE="-1"> 
   <PARAM NAME="ShowCaptioning" VALUE="0"> 
   <PARAM NAME="ShowGotoBar" VALUE=0"> 
   <PARAM NAME="ShowStatusBar" VALUE="0"> 
   <PARAM NAME="ShowTracker" VALUE="-1"> 
   <PARAM NAME="TransparentAtStart" VALUE="-1"> 
   <PARAM NAME="VideoBorderWidth" VALUE="0"> 
   <PARAM NAME="VideoBorderColor" VALUE="0"> 
   <PARAM NAME="VideoBorder3D" VALUE="0"> 
   <PARAM NAME="WindowlessVideo" VALUE="0"> 
</OBJECT> 
</div>
windows media player may be IE only though
"


Hi I'm a new member and stumbled upon this page while trying to find out how to have a drop down list and a media player and thanks to _Aerospace_Eng_
for this wonderful code! but can I ask someone...can you edit this code to play like the first song on the list automaticaly so ppl don't have to click play when they come to my page. (I'm using music links from sites that offer free music links and midi so they aren't downloaded) I've tried changing this line to <PARAM NAME="AutoStart" value="true"> but I'm stumped...I don't know too much about HTML......MUCH THANKS!

Last edited by AprilZan; 05-31-2005 at 07:57 PM..
AprilZan is offline  
Closed Thread

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:35 PM.


Advertisement
Log in to turn off these ads.