View Full Version : Embedded Windows Media Player
paulajackson
01-20-2005, 04:56 PM
I've created a webpage in Frontpage and inserted a Windows Media Player via Insert ActiveX menu. I can modify the Filename parameter to an mp3 file.
But I want the page to have a list of three mp3 filenames and for the user to click on any one which will then play in the embedded player.
I tried creating a list of the files in a m3u text file but the player just plays them one after the other.
Could someone tell me what code I need to add so the clicked filenames will change the Filename parameter to another mp3 file?
I found a site where an example had it as a drop down menu but I can't work out how to change this to a list. If someone could guide me with a bit of code or something, I'd be very grateful.
Thanks
:)
_Aerospace_Eng_
01-20-2005, 07:50 PM
<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
hey............. thats cool any more stuff like that
paulajackson
01-20-2005, 11:13 PM
Thanks Aerospace Eng. Thats brilliant and you are a star.
:D
_Aerospace_Eng_
01-21-2005, 12:27 AM
wut kind of "stuff" mcq?
and yw paula :thumbsup:
paulajackson
01-21-2005, 11:24 AM
I tried the code and its nearer to what I'm after which is cool.
However, I was wanting to have buttons instead of a drop down list. I've tinkered with it using radio buttons to select the songs. The only thing is that you can select a track but it won't play until you select another radio button. eg You select "song 1" but it won't play until you select either "song 2" or "song 3", or press the play button. Is there a way of making each radio button play the song that is selected?
I've included the code that I've modified putting in the song titles in the right place. If you tell me which bit I need to tweak I'd be immensely happy.
I'm guessing there's just one parameter that needs changing but I can't work out which it is.
Thanks
P
code below
<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 onchange=document.all.music.filename=document.all.song1.value; TYPE="RADIO" NAME="Music" VALUE="song1.m3u">Song 1
</p>
<p><INPUT id=song2 onchange=document.all.music.filename=document.all.song2.value; TYPE="RADIO" NAME="Music" VALUE="song2.m3u">Song 2
</p>
<p>
<INPUT id=song3 onchange=document.all.music.filename=document.all.song3.value; TYPE="RADIO" NAME="Music" VALUE="song3.m3u">Song 3</p>
_Aerospace_Eng_
01-21-2005, 03:06 PM
you almost had it, u need to use onclick for this one
<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>
paulajackson
01-21-2005, 04:31 PM
Bingo.
Thanks a lot for that.
Best wishes
Paul
froze
01-24-2005, 07:16 PM
I have an embedded media player in my site and i like this code. Is there a way to make it randomly select a track at the begining and then continue to play through the playlist or continue to play random tracks? Thanks.
aaroncavanaugh2
02-03-2005, 07:47 PM
Hi,
I like this script, but I have two questions. First, can I disable or remove the fast forward button? Second, how can I show what is currently playing?
I will be using this script to play archived radio shows.
Thanks guys. God Bless.
Aaron.
froze
02-03-2005, 11:55 PM
To show current song (and other stream info):
Find line:
<OBJECT id=music height=44 width=230 classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95>
Replace with:
<OBJECT id=music height=70 width=230 classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95>
Find line:
<param name="ShowStatusBar" value="0">
Replace with:
<param name="ShowStatusBar" value="1">
You may need to adjust the width of the player in the first edit as well to suit your needs.
Im not sure about disabling the fast forward button. I suggest you play around with some of the params. Hope this helps.
_Aerospace_Eng_
02-04-2005, 12:12 AM
find this line <param name="ShowPositionControls" value="-1"> and change it to <param name="ShowPositionControls" value="0">
aaroncavanaugh2
02-04-2005, 01:07 AM
Thank You for your help. You guys are really helpful.
God Bless.
Aaron.
expertcoder
02-06-2005, 10:16 PM
very nice and simple code.
snensi
03-01-2005, 08:31 PM
Hi Aerospace_Eng & others:
I have noticed that you guys have selection of songs by the use of drop-down/select or Input/Radio... and was wondering if its possible to link via regular Linking? (just DIV and Href)?
you almost had it, u need to use onclick for this one
<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>
_Aerospace_Eng_
03-01-2005, 09:18 PM
yes its possible, u can set up a link like this
<a href="yoursong.mp3" onclick="document.all.music.filename='yoursong.mp3';return false">Play Song</a>
that should work
_=DUFF=_
03-06-2005, 12:51 AM
youll probably call me a noob but say i would like it to support video to under the same menu how would i do this???
_Aerospace_Eng_
03-06-2005, 01:40 AM
increase the height of the player and instead of songs just put values of the videos, when i have time i will try to make this player cross browser functional, i think i know how just haven't gotten around to it
_=DUFF=_
03-06-2005, 02:18 AM
i tried to do that but without any succes the most i got was the player to show but it wouldent reload and play. if you want i can send you the code
codegoboom
03-06-2005, 03:16 AM
If you really wanna know "how to do" whatever with the media player, look no further than its SDK... find it here (http://www.microsoft.com/windows/windowsmedia/default.aspx).
Ferrence
03-15-2005, 08:29 PM
yes its possible, u can set up a link like this
<a href="yoursong.mp3" onclick="document.all.music.filename='yoursong.mp3';return false">Play Song</a>
that should work
Hi i am having a specific problem with embedding Windows media player in my webpage.
I have the embedded player. And i have a few logo's.
What i want is that when i click on a certain logo the player starts to play a certain file.
If it is possible it should work like the following site. www.nederland.fm
Just to click on something and the music will start to play.
Can anybody help me? I have been googling for over a month now...
_Aerospace_Eng_
03-15-2005, 08:46 PM
use the same method as you have quoted that i wrote, rather than putting Play Song in between the a tags but your logo in between them using the image tag
Ferrence
03-15-2005, 09:57 PM
Thanks for your reply
However when i do it like that, the song will open in wmp outside the webpage, and i want it to open in the embedded player
probably im doing it wrong, maybe you can help me
i have combined your post into the following code maybe we can work i out
<div align=center>
<p>
<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>
</p>
<p> <a href="rip.m3u" onclick="document.all.music.filename='C:\Documents and Settings\Jurgen\Bureaublad\mp3\';return false">Play Song</a></p>
</div>
_Aerospace_Eng_
03-15-2005, 10:30 PM
this isn't right
<a href="rip.m3u" onclick="document.all.music.filename='C:\Documents and Settings\Jurgen\Bureaublad\mp3\';return false">Play Song</a> where is the m3u playlist relative in position to the page that has the player on it? the filename needs to equal an actual file not a directory, are u saying that doesn't work? try this instead
<a href="javascript:;" onclick="document.all.music.filename='rip.m3u';return false">Play Song</a>
Ferrence
03-16-2005, 08:37 AM
:) Thanks :) it works!!!
now i can build my site, this is what i needed
keep it up :thumbsup:
Scootertaj
03-16-2005, 05:38 PM
Nice work Aerospace :thumbsup: ! I never could have done that, have you had experience with this kinda stuff? How did you do it?
codegoboom
03-16-2005, 05:54 PM
Indeed.
damn kids... :D
_Aerospace_Eng_
03-16-2005, 06:05 PM
do what have the drop down menu change the song of the player? its just simple javascript, i've been teaching myself javascript, and i know how certain things work and what not, but being pretty good in C Programming other programming languages come naturally to me, i've said i would make this cross browser functional just haven't had the time yet, i write a script thought that does the same thing but it doesn't use the object tag it uses the embed tag, here is one that works on most browsers that are on a windows OS, that have windows media player
<!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>
<div id="jukebox">JUKEBOX<br><br>
<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>
<option value="http://urltosong6.mp3">Song 6</option>
<option value="http://urltosong7.mp3">Song 7</option>
<option value="http://urltosong8.mp3">Song 8</option>
<option value="http://urltosong9.mp3">Song 9</option>
<option value="http://urltosong10.mp3">Song 10</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>
for some strange reason for it to work in the gecko browsers the value to the song file has to be absolute
wenwen8282
03-17-2005, 05:23 PM
undefined
undefined
Hi hi, I would like to say that the above media player codes work miracles. U r really genius man!!! :thumbsup: Hahaha :P I would like to enquire whether there are any codes to let the songs play automatically one by one without the users having to press any buttons? Tks a million!!! :)
_Aerospace_Eng_
03-17-2005, 07:24 PM
yes rather than having mp3 files as the values u can use an .m3u playlist, check out this site (http://hanna.pyxidis.org/tech/m3u.html) any m3u file can be opened in notepad.
wenwen8282
03-20-2005, 04:23 AM
Hi hi, thanks for the reply. Am just wondering whether it is possible to use Javascript or HTML code to create a playlist that will play songs one after another automatically instead of using notepad??? Tks a million!!! :P
_Aerospace_Eng_
03-20-2005, 04:34 AM
did you even read my post? there is a link in there that explains how to make a playlist(that plays by itself moving from song to song) using notepad, then rather than linking to mp3 files you would link to .m3u files, notepad is just the easiest program to use to make a playlist type file which is y i suggested it
wenwen8282
03-20-2005, 08:15 AM
Hi Aerospace, am sorry, but u see, am planning to embed the player in my blog and not website, therefore, I wun be able to upload files... So am just wondering whether there is any method to play songs automatically one after another using Javascript or HTML. Tks a lot... :P
_Aerospace_Eng_
03-20-2005, 06:20 PM
okay thats fine the playlist will work as long as u can upload .m3u files and the location of the files are correct, please read the link in my post, the files dont have to be on your hard drive, they can be anywhere on the net and the m3u file will play the songs one by one automatically moving from one song to the other when the previous one has finished, y make things harder than they have to be
wenwen8282
03-21-2005, 02:04 AM
Hi hi Aerospace, is it possible to link the playlist from http://webjay.org/ (http://webjay.org/) to my embedded player??? Tks and sorry for the trouble, cos am quite new in this field... :P
_Aerospace_Eng_
03-21-2005, 07:34 PM
okay lets try this again since my previous posts have seemed to be unclear to you (don't know how), i will explain this step by step so you have NO problems of understanding what to do!!
1. Open notepad.exe or notepad (same program) then type this as your first line
#EXTM3U
2. On the next line type this, it will be what you want displayed on the status bar of the player if you have it enabled
#EXTINF:Artist of Song Goes Here - Title of Song Goes Here
3. On the line after that type this, it will be the exact location relative to your root directory on your server for compatibility put the exact location of the file
http://locationtosongfilehere.mp3
4. You have now made a playlist for one song, to have multiple songs repeat steps 2-3 for the other songs, for example a playlist with 5 songs would look like this
#EXTM3U
#EXTINF:Artist of Song 1 Goes Here - Title of Song 1 Goes Here
http://locationtosongfile1here.mp3
#EXTINF:Artist of Song 2 Goes Here - Title of Song 2 Goes Here
http://locationtosongfile2here.mp3
#EXTINF:Artist of Song 3 Goes Here - Title of Song 3 Goes Here
http://locationtosongfile3here.mp3
#EXTINF:Artist of Song 4 Goes Here - Title of Song 4 Goes Here
http://locationtosongfile4here.mp3
#EXTINF:Artist of Song 5 Goes Here - Title of Song 5 Goes Here
http://locationtosongfile5here.mp3
5. Now that you know what it looks like, you have to save it, click on the File menu in notepad, then click on save as, to the left of the save and cancel buttons you will see 3 boxes, the first box is the filename that you want to save it as, the second box is the file type (change this to all types), and the last one is encoding type, DO NOT change this box. In the file name box after you have changed the second box to all types, you should type in this
yourplaylistfilename.m3u
find the location you want to save your file at, this will be needed later so u can upload your playlist file, once u find your location to save the file, click save, you will now see a file that has the name u gave it this will be your playlist
6. Upload your playlist(s) to your server, and in the media player code that is on this thread, rather than having values of mp3 files you should change the value to .m3u, so for example the stuff in bold should look something like the values that you should use
<!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>
<div id="jukebox">JUKEBOX<br><br>
<select id="cancion" onchange="song()" size="1">
<option value="none">::::::::::::: Choose Your Song Here :::::::::::::</option>
<option value="http://urltosong1playlist.m3u">Playlist 1</option>
<option value="http://urltosong2playlist.m3u">Playlist 2</option>
<option value="http://urltosong3playlist.m3u">Playlist 3</option>
<option value="http://urltosong4playlist.m3u">Playlist 4</option>
<option value="http://urltosong5playlist.m3u">Playlist 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>
7. If you had read this page click here (http://hanna.pyxidis.org/tech/m3u.html) earlier which I dont think you did, I wouldn't have had to spend my time writing this semi tutorial up for you
8. Any questions?
P.S. Someone should make this a sticky (glares at mods)
codegoboom
03-21-2005, 09:25 PM
make this a sticky
You said it! :thumbsup:
I vote for sub-forum. ;)
aaroncavanaugh2
04-04-2005, 05:30 AM
Hi,
To see how the radio button works go to www.Christianradio.me.uk and click on the archives link.
Thanks. God Bless.
Aaron.
_Aerospace_Eng_
04-04-2005, 06:32 AM
which version did u use? the older one or the newer one? i made it use the embed tag so it works for the gecko browsers also.
Descendants
04-18-2005, 03:27 AM
not sure am i late in here but i have some problems that totally differs.
Is there a way to make window media player to play files which wasnt target on playlist but instead it had a browse button where u could browse to your own windows directory and have it played music.
to be more specific:
embed src="locationoffile.mp3" to be configure to a fact that
embed src="file"
where file value ="browse on your pc for any available mp3 to be played not playlist"
Its like adding an eject button for window media player
_Aerospace_Eng_
04-18-2005, 06:02 AM
Okay so yes it is possible to do this clientside, here you go, enjoy.
<!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>Jukebox</title>
<style type="text/css">
<!--
div#music1 {
text-align:center;
}
div#playlist {
text-align:center;
}
-->
</style>
<script type="text/javascript">
<!--
function song(what){
document.getElementById("music1").innerHTML='<object id="mediaplayer1" width="200" height="45" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"><param name="URL" value="'+what+'"><param name="AutoStart" VALUE="True"><param name="uiMode" value="full"><embed type="application/x-mplayer2" src="'+what+'" ShowControls="1" AutoStart="1" width="200" height="45"></embed></object>';
return false;
}
//-->
</script>
</head>
<body>
<div id="playlist">
Browse for a song to play from your PC, and then click submit
<form onsubmit="return song(document.getElementById('thefile').value)">
<input type="file" name="thefile" id="thefile"><br>
<input type="submit" value="Submit">
</form>
</div>
<div id="music1">
<object width="200" height="45"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject">
<param name="URL" value="">
<param name="AutoStart" VALUE="True">
<param name="uiMode" value="full">
<embed type="application/x-mplayer2"
src=""
ShowControls="1"
width="200"
height="45">
</embed>
</object>
</div>
</body>
</html>
Descendants
04-18-2005, 09:13 AM
wow that was a real quick reply... thanks anyways.This is what i had been lookin for.thanks for solving this problem.. i had been figuring this problem for like 3 days ......
_Aerospace_Eng_
04-18-2005, 09:52 AM
Take out the method="get" from the file input, it shouldn't go there sorry.
Descendants
04-18-2005, 10:13 AM
Erm.. i was thinking if i could request another help regarding showing a scrolling marquee of which shows the song title.. i reconfigure some of the settings which now looks like this.when opening the html it would show exactly what i mean.. Thanks again
<!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>Jukebox</title>
<style type="text/css">
<!--
div#music1 {
text-align:right;
}
div#playlist {
text-align:right;
}
-->
</style>
<script type="text/javascript">
<!--
function song(what){
document.getElementById("music1").innerHTML='<object id="mediaplayer1" width="235" height="160" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"><param name="URL" value="'+what+'"><param name="AutoStart" VALUE="True"><param name="uiMode" value="full"><embed type="application/x-mplayer2" src="'+what+'" ShowControls="1" AutoStart="1" width="235" height="160"></embed></object>';
return false;
}
//-->
</script>
</head>
<body>
<div id="music1">
<object width="235" height="160"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject">
<param name="URL" value="">
<param name="AutoStart" VALUE="True">
<param name="uiMode" value="full">
<embed type="application/x-mplayer2"
src=""
ShowControls="1"
width="235"
height="160">
</embed>
</object>
</div>
<div id="playlist">
<form onsubmit="return song(document.getElementById('thefile').value)">
<input type="file" name="thefile" id="thefile" method="get"><BR>
<input type="submit" value="Play">-Song Title Over here Scrolling-
</form>
</div>
</body>
</html>
_Aerospace_Eng_
04-18-2005, 11:35 AM
<!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>Jukebox</title>
<style type="text/css">
<!--
div#music1 {
text-align:right;
}
div#playlist {
text-align:right;
width:240px;
float:right;
}
#scroll {
width:200px;
height:25px;
right:0px;
position:absolute;
}
-->
</style>
<script type="text/javascript">
<!--
function song(what){
document.getElementById("music1").innerHTML='<object id="mediaplayer1" width="235" height="160" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"><param name="URL" value="'+what+'"><param name="AutoStart" VALUE="True"><param name="uiMode" value="full"><embed type="application/x-mplayer2" src="'+what+'" ShowControls="1" AutoStart="1" width="235" height="160"></embed></object>';
document.getElementById("marquee").innerHTML=document.getElementById('thefile').value;
return false;
}
//-->
</script>
</head>
<body>
<div id="music1">
<object width="235" height="160"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject">
<param name="URL" value="">
<param name="AutoStart" VALUE="True">
<param name="uiMode" value="full">
<embed type="application/x-mplayer2"
src=""
ShowControls="1"
width="235"
height="160">
</embed>
</object>
</div>
<div id="playlist">
<form onsubmit="return song(document.getElementById('thefile').value);" style="margin:0px;" method="post">
<input type="file" name="thefile" id="thefile"><br>
<input style="float:left;" type="submit" value="Play">
<marquee id="scroll"><span id="marquee"> </span></marquee>
</form>
</div>
</body>
</html>
next time try to make an attempt at this, it uses the same innerHTML method that I have already used.
Descendants
04-18-2005, 11:57 AM
Thanks for the help .Sorry for request a spoonfeed query.I had been quite bad in javas and text aligning.it took me sometime to figure how to align the player and browse button so as the play button to the right side.
kippekai
04-19-2005, 08:36 AM
I was hoping someone could answer my question.
I'm embedding a media player in a simple web page, which I sucessfully completed, but I'm curious if there is a solution to a couple of problems.
First problem, when I acess the page with the embedded media player using IE, the browser will block active X or I get "this page contains both secure or non-secure items". All my photos and vids linked to this page are on the same server. I know its the media player causeing IE to block since I've removed the player and did not get that block.
Any idea how to stop IE from blocking.
Second problem may be related to the first. When I try to access the page with FireFox the mediaplayer doesnt even show up.
I'm using Frontpage 2003, and inserting the player with the component add-in button.
_Aerospace_Eng_
04-19-2005, 09:06 AM
The alert should stop when you upload your page onto the internet. Please try this code, it uses the embed tag, but its the only way that I know is supported in FF and IE, I can use the object tag using a different mime type but this isn't supported in IE
<!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>
<div id="jukebox">JUKEBOX<br><br>
<select id="cancion" onchange="song()" size="1">
<option value="none">::::::::::::: Choose Your Song Here :::::::::::::</option>
<option value="http://urltosong1playlist.m3u">Playlist 1</option>
<option value="http://urltosong2playlist.m3u">Playlist 2</option>
<option value="http://urltosong3playlist.m3u">Playlist 3</option>
<option value="http://urltosong4playlist.m3u">Playlist 4</option>
<option value="http://urltosong5playlist.m3u">Playlist 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>
change the option values to whatever media type you wish.
kippekai
04-19-2005, 09:24 AM
Thanks so much for the reply. One problem though. That snippet of code is for an audio player. Do you have a code snippet for the entire media player? I'm looking to show a video clip of game play.
Thanks again for your reply.
_Aerospace_Eng_
04-19-2005, 09:31 AM
Adjust the height of the embed tag to adjust for the video size.
kippekai
04-19-2005, 10:48 AM
Your code works great in IE, and I now can see the player in Firefox. But, when Firefox attempts to open the file a Media Player dialog pops up with this error "The file you are attempting to play has an extension that does not match the file format. Playing the file may result in unexpected behavior". Then the file cant be played.
I'm trying to stream a .wmv file, and I'm wondering if a different file format is better.
Any suggestions?
Thanks.
P.S. Sorry for being such a noob.
_Aerospace_Eng_
04-19-2005, 12:36 PM
hmm was it orginally a wmv file? or did you just change the file extension? Can you post a link?
kippekai
04-19-2005, 09:00 PM
Below is the link to my web page. I dont think the file was changed. Though when I video edited the file, i was compressed a bit more, though the file type remained.
I cant stand these multiple browsers, un-uniformity is setting back the internet rather than going forward. I could see how web devs must get frustrated when these new browsers pop up.
_Aerospace_Eng_
04-19-2005, 09:27 PM
Okay I want to say its the codec that was used to encode the video once you compressed it. Firefox I believe is unable to read the video because of the codecs that its able to understand and the one you used might not be one of them.
kippekai
04-19-2005, 09:35 PM
Thanks. I'll try a differnt file format in its native form and post back with the results.
_Aerospace_Eng_
04-19-2005, 10:26 PM
Okay cool, but something I did discovered was that the video did play but only when a form was used to play it. When it played the video seemed to play at a very large resolution. Check it out for yourself here (http://prdesignz.inraged-inc.com/jukebox.html)
kippekai
04-22-2005, 07:01 AM
OK, so I went round and round a bit trying to find out why my embedded streams dont work in Firefox. Apparently it appears to be server related issues.
My files are stored on a Comcast.net personal account server. When I brought this issue up in a comcast forum, I was told the server is not secure, and NOT to use HTTPS as a URL, but use HTTP instead.
So I experimented. Using HTTP works fine in Firefox, but crasshes or becomes unstable in Internet Explorer. Now I'm no code master, so I figured maybe theres a way to get IE to use HTTPS url and Firefox to use HTTP. So I tried the embed generator (http://cit.ucsf.edu/embedmedia/step1.php) and its code produces a cross browser function that appears to work.
In the OBJECT url I used HTTPS...In the EMBED url I used HTTP. Example code shown below.This appears to work, though I have no clue why.
Only one problem left. The OBJECT tags seem to generate a "This page contains both secure and non secure items" warning when vieing with Internet Explorer, which is something I would like to get rid of.
Any suggestions.
EXAMPLE CODE:
<OBJECT id='mediaPlayer' width="370" height="350"
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="https://your path">
<param name='animationatStart' value='true'>
<param name='transparentatStart' value='false'>
<param name='autoStart' value="false">
<param name='showControls' value="true">
<param name='loop' value="false">
<PARAM NAME="windowlessVideo" VALUE="true">
<EMBED type='application/x-mplayer2'
pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1'
bgcolor='darkblue' showcontrols="true" showtracker='-1'
showdisplay="0" showstatusbar='-1' videoborder3d='-1' width="370" height="350"
src="http//:your path" autostart="0" designtimesp='5311' loop="false">
</EMBED>
</OBJECT>
_Aerospace_Eng_
04-22-2005, 07:08 AM
Are you testing your page offline or online? I've told you this already once you upload your page to your server you wont get that warning message. The message happens on systems with SP2 only locally though. If I had known that you were only displaying one video, then I would have told you about the generator a while back.
kippekai
04-22-2005, 07:12 AM
I always upload prior testing, heres the link.
I'm wondering if the warning goes away after it been upoladed for an hour or so.
_Aerospace_Eng_
04-22-2005, 07:15 AM
Oh that warning, only way to prevent that is to not use https the user can set this site to a site that bypasses the alert but nothing you can do about except from what i've told you already which was to not use https.
kippekai
04-22-2005, 07:27 AM
I took out all references to https and replaced with http, but still get the message.
I though the OBJECT tags were causing the message. I'll check back on the file later to see if the message dissapears, since I recal that happening before. Is it possible my server needs time to authenticate or something??
_Aerospace_Eng_
04-22-2005, 07:48 AM
What url are you referencing? Its the https url that is calling up the warning. This url (http://home.comcast.net/~excalbiur/testynew.htm) however doesn't return the warning
kippekai
04-22-2005, 08:17 AM
Yeah, I'm all screwed up, but I think I got right now. I took out the HTTPS and replaced the urls with HTTP. So now it seems to be working fine.
I'm trying out different codes for embedding, so this link may get screwy.
Thanks for helpin such a noob. :thumbsup:
riech520
05-01-2005, 12:50 PM
I really luv your code!!
and I just have one question, but I don't know if you answered it yet.
Is there a way to randomly play a song in the beginning when the webpage is opened instead of having the person choose a song from the list?? :confused:
_Aerospace_Eng_
05-01-2005, 01:04 PM
<!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>
<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")
//-->
</script>
</head>
<body>
<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>
</body>
</html>
riech520
05-01-2005, 09:30 PM
Oh..
I was wondering if I could keep the drop down list AND have a song started playing in the beginning..
thanks anyway though!!! :)
_Aerospace_Eng_
05-01-2005, 09:38 PM
I really luv your code!!
and I just have one question, but I don't know if you answered it yet.
Is there a way to randomly play a song in the beginning when the webpage is opened instead of having the person choose a song from the list?? :confused:
I had a feeling you were going to say that, in the future, please be clear on what exactly it is that you want. This could have saved both of us another post.
<!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>
riech520
05-01-2005, 09:46 PM
I'm so sorry....
but thanks for the big help!!!
ogmium
05-10-2005, 01:33 PM
I have been trying to set up a player which can be used in Active Desktop to play back local files from a playlist held on the local drive as a screensaver/desktop and am experiencing some issues:
I have seen that the M3U format for the playlist is recommended earlier. I have been using ASX type in the format which Microsoft show on their web site along the lines of:
<ASX version = "3.0">
<TITLE>Basic Playlist Demo</TITLE>
<REPEAT>
<ENTRY>
<TITLE>LIST1</TITLE>
<AUTHOR>LANDSCAPE</AUTHOR>
<COPYRIGHT>(c)2005 Landscape Channel</COPYRIGHT>
<REF HREF = "c:\screensaver\L0036.MPG" />
</ENTRY>
<ENTRY>
<TITLE>LIST1</TITLE>
<AUTHOR>LANDSCAPE</AUTHOR>
<COPYRIGHT>(c)2005 Landscape Channel</COPYRIGHT>
<REF HREF = "c:\screensaver\L0006DVD.MPG" />
</ENTRY>
<ENTRY>
<TITLE>LIST1</TITLE>
<AUTHOR>LANDSCAPE</AUTHOR>
<COPYRIGHT>(c)2005 Landscape Channel</COPYRIGHT>
<REF HREF = "c:\screensaver\L0005DVD.MPG" />
</ENTRY>
</REPEAT> </ASX>
What is the benefit of M3U as against ASX?
However this has a number of problems - fade to black flips through white at the end of every clip and we use MPG and WMV files. We want to deliver a new list every day to our users who cache the files on their local hard drive using some management software.
Second problem is startup is at the same point if you stop the player again. We would like it to start where you left off - is that possible?
regards
Nick
Landscape
aaroncavanaugh2
05-11-2005, 10:39 PM
Hi AerospaceEng,
The original post you made with the dropdown list. I want to use this but with WMV files. The version posted there does not work with WMV files. I tried changing the classID and that does not work it won't even start playing the files. Will you help me?
Obviously I changed the height and width. Can play mpeg just not wmv.
Nevermind. I uploaded it to the server and it worked fine.
Thanks. God Bless.
Aaron.
bluedoglov
05-12-2005, 02:07 PM
Hi,
I am using this code on my web site. I would like to ramdomly continue to have songs play after the first song. How is this done??
Thanks,
Michele
<!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>
_Aerospace_Eng_
05-17-2005, 12:29 AM
Random after play time huh? This isn't easy, if I have the time I might be able to work something up, but I can set you off in the right direction. A minor drawback for what you want to do is 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.
leopold
05-17-2005, 03:16 AM
hello,
i've read this entire topic and it was definetely useful but i was wondering about something else:
i want to have a non-visible embedded media player on my website linked to a m3u playlist, with my own custom-made previous-play-pause-next buttons that control the media player, i tried it with a code like this and when i press play it does work but when i press next it does go to the next song but i have to press play again before the song starts...
also: is there any way i can have the title of the song (as stated in the m3u file) displayed on my site?
i hope anyone can help me, thanks in advance!
here is the code i have been using:
<body>
<OBJECT ID="WinMedia" width=0 height=0
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="playlist.m3u">
<PARAM NAME="AutoStart" Value="True">
<PARAM NAME="ShowControls" VALUE="False">
<PARAM NAME="ShowStatusBar" VALUE="True">
<EMBED type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/
MediaPlayer/" SRC="yourfile.asx" name="WinMedia"
autostart=1 width=160 height=120 ShowStatusBar=true
ShowControls=false>
</EMBED>
</OBJECT>
<A HREF="javascript:document.WinMedia.Previous()">
<IMG SRC="previous.gif" BORDER="0"</A>
<A HREF="javascript:document.WinMedia.Play()">
<IMG SRC="play.gif" BORDER="0"
ALT="PLAY BUTTON"></A>
<A HREF="javascript:document.WinMedia.Pause()">
<IMG SRC="pause.gif" BORDER="0"
ALT="PAUSE BUTTON"> </A>
<A HREF="javascript:document.WinMedia.Next()">
<IMG SRC="next.gif" BORDER="0"></A>
</body>
enumerator
05-18-2005, 01:34 AM
FYI, HTML+TIME (http://msdn.microsoft.com/workshop/author/behaviors/reference/time2/htime_node_entry.asp) is more useful than the media player control for such things...
_Aerospace_Eng_
05-18-2005, 01:38 AM
In reference to leopold's post, you have some conflicting filename values, your embed src is different from the filename parameter value. Also you should be using quotes around your values. This embedded media player generator (http://cit.ucsf.edu/embedmedia/step1.php) should prove helpful, to avoid any coding errors on the player that you might make.
ogmium
05-18-2005, 07:13 PM
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.
bluedoglov
05-18-2005, 08:05 PM
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
<!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>
Stewball
05-20-2005, 04:30 AM
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
<%@ 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
<input TYPE="image" src="volmax_button.gif" class="" onmouseover=""; onmouseout=""; value="" name="" onclick="location.reload(true);">
<input TYPE="image" src="play_button.gif" class="but21" onmouseover=this.className="but22"; onmouseout=this.className="but21"; value="Play " name="play" onclick="play();">
<input TYPE="image" src="stop_button.gif" class="but41" onmouseover=this.className="but42"; onmouseout=this.className="but41"; value="Stop" name="stop" onclick="stop();">
<input TYPE="image" src="pause_button.gif" class="but31" onmouseover=this.className="but32"; onmouseout=this.className="but31"; value="Pause" name="pause" onclick="pause();">
<input TYPE="image" src="mute_button.gif" class="but61" onmouseover=this.className="but62"; onmouseout=this.className="but61"; value="Mute" name="mute" onclick="mute();">
<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);">
<input TYPE="image" src="volmax_button.gif" class="but61" onmouseover=this.className="but62"; onmouseout=this.className="but61"; value="+" name="volup" onclick="volup();"><BR>
<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
05-20-2005, 04:33 AM
Copy and paste this code into a webpage and name it songselect.asp
<%
' ***************************************************************************
' 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>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=b&B1=Search" >B</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=c&B1=Search" >C</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=d&B1=Search" >D</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=e&B1=Search" >E</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=f&B1=Search" >F</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=g&B1=Search" >G</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=h&B1=Search" >H</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=i&B1=Search" >I</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=j&B1=Search" >J</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=k&B1=Search" >K</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=l&B1=Search" >L</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=m&B1=Search" >M</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=n&B1=Search" >N</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=o&B1=Search" >O</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=p&B1=Search" >P</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=q&B1=Search" >Q</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=r&B1=Search" >R</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=s&B1=Search" >S</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=t&B1=Search" >T</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=u&B1=Search" >U</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=v&B1=Search" >V</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=w&B1=Search" >W</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=x&B1=Search" >X</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=y&B1=Search" >Y</A>
<A href="songselect.asp?TypeSearch=FirstName&DaInBox=&B1=Search" >Z</A>
<!--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>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=b&B1=Search" >B</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=c&B1=Search" >C</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=d&B1=Search" >D</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=e&B1=Search" >E</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=f&B1=Search" >F</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=g&B1=Search" >G</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=h&B1=Search" >H</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=i&B1=Search" >I</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=j&B1=Search" >J</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=k&B1=Search" >K</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=l&B1=Search" >L</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=m&B1=Search" >M</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=n&B1=Search" >N</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=o&B1=Search" >O</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=p&B1=Search" >P</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=q&B1=Search" >Q</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=r&B1=Search" >R</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=s&B1=Search" >S</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=t&B1=Search" >T</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=u&B1=Search" >U</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=v&B1=Search" >V</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=w&B1=Search" >W</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=x&B1=Search" >X</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=y&B1=Search" >Y</A>
<A href="songselect.asp?TypeSearch=LastName&DaInBox=&B1=Search" >Z</A>
<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>
rrldance
05-20-2005, 05:47 AM
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.
_Aerospace_Eng_
05-20-2005, 06:33 AM
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.
bluedoglov
05-20-2005, 01:28 PM
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
Toxic_2
05-20-2005, 04:50 PM
This is perfect for my website but why doesn't it play when i click on the individual songs what am i missing :confused:
<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
_Aerospace_Eng_
05-20-2005, 08:39 PM
Try this one instead
<!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
05-21-2005, 02:42 PM
Thanks so much it works perfectly,you guys are amazing :D
Try this one instead
<!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.
websnow
05-31-2005, 06:06 PM
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
you almost had it, u need to use onclick for this one
<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>
_Aerospace_Eng_
05-31-2005, 06:19 PM
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.
<!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
05-31-2005, 06:56 PM
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
---
---
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.
<!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
05-31-2005, 07:01 PM
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
AprilZan
05-31-2005, 08:49 PM
"<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! :thumbsup:
_Aerospace_Eng_
06-02-2005, 06:17 AM
Okay most browsers will still read the deprecated embed tag, but to be up to standards, here is an updated version one version (the 2nd one) uses the embed tag for the browsers who don't understand the object tag, and the other version (the 1st one) uses the object tag which is understood in the latest browsers out. The 1st one might break on a Mac OS.
<!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;
}
form {
margin:0;
padding:0;
}
-->
</style>
<script type="text/javascript">
<!--
function PlayIt(){
document.getElementById('music1').innerHTML='<object id="mediaplayer" type="application/x-mplayer2" width="300" height="45" data="'+document.getElementById('cancion').value+'">'
+'<param id="media1" name="src" value="'+document.getElementById('cancion').value+'">'
+'<param id="media2" name="filename" value="'+document.getElementById('cancion').value+'">'
+'<param name="type" value="application/x-mplayer2">'
+'Your system does cannot find the windows media player that was specified.'
+'</object>'
}
//-->
</script>
</head>
<body onload="document.forms['player'].reset()">
<form name="player" action="" method="">
<select name="" id="cancion" onchange="PlayIt()" 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>
<option value="http://urltosong6.mp3">Song 6</option>
<option value="http://urltosong7.mp3">Song 7</option>
<option value="http://urltosong8.mp3">Song 8</option>
<option value="http://urltosong9.mp3">Song 9</option>
<option value="http://urltosong10.mp3">Song 10</option>
</select>
</form>
<span id="music1">
<object type="application/x-mplayer2" width="300" height="45" data="">
<param name="src" value="">
<param name="filename" value="">
<param name="type" value="application/x-mplayer2">
Your system does cannot find the windows media player that was specified.
</object>
</span>
</body>
</html>
This works in IE6, FF1.04, Opera 8.0 for PC.
It might break in IE for Mac due to the system structure.
If you don't care about standards, and want to ensure the most cross browser compatability using the object tag and embed tag, then you can use this
<!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;
}
form {
margin:0;
padding:0;
}
-->
</style>
<script type="text/javascript">
<!--
function PlayIt(){
document.getElementById("music1").innerHTML='<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="'+document.getElementById('cancion').value+'">'
+'<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="'+document.getElementById('cancion').value+'" autostart="true" designtimesp="5311" loop="true">'
+'</embed>'
+'</object>'
}
//-->
</script>
</head>
<body onload="document.forms['player'].reset()">
<form name="player" action="" method="">
<select name="" id="cancion" onchange="PlayIt()" 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>
<option value="http://urltosong6.mp3">Song 6</option>
<option value="http://urltosong7.mp3">Song 7</option>
<option value="http://urltosong8.mp3">Song 8</option>
<option value="http://urltosong9.mp3">Song 9</option>
<option value="http://urltosong10.mp3">Song 10</option>
</select>
</form>
<span id="music1">
<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="">
<param name="animationatStart" value="true">
<param name="transparentatStart" value="true">
<param name="autoStart" value="false">
<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="" autostart="false" designtimesp="5311" loop="true">
</object>
</span>
</body>
</html>
AprilZan to answer your question use one of the updated scripts in this post the second one is the one you might want to use, its less bulky and is most cross browser compatable. If you want the first song to play set the filename value in the object to the first song value, and also set the src in the embed tag to the first sound value. You need to set the autostart parameter to true and the autostart attribute in the embed tag to true as well.
numanme
06-18-2005, 04:12 PM
Been playing with this Media Player code for sometime now this is what I have done all I need now is the code to stop Play with a JPG or Gif button can anyone help
Click on this link and look for the media player top right hand corner
click here (http://homepage.ntlworld.com/richard.churchward/numanme/home.htm)
aswin_teja
06-20-2005, 10:52 PM
whew! :eek: :thumbsup:
7 pages full of discussion abt windoes media player streaming !! .. just lookd almost all pages .. n thanx peeps .. u really rock !! :thumbsup: :thumbsup:
got one mo doubt finally ... can we change the color of the windows media player ? like .. its pale blue by default ( on my pc ) .. like say .. some otha color ?
and yeah .. im new to web-designing .. can u ppl please tell abt the basic scructure of the <object> code of the windows media player ..pls .. i mean ...wat params mean wat n stuff :D wd b thankful :D
finally .. can u please also suggest wat languages i shd b learnin to bcum a good webdesigner ? like i know basic vb , c , java , flash , html n stuff ..
thanx guys .. hopin fer ur help .. i really wanna becum lyk one ov u guys :D :rolleyes: :rolleyes:
enumerator
06-21-2005, 12:04 AM
As mentioned, it's all documented: http://msdn.microsoft.com/library/en-us/dnanchor/html/audiovideo.asp
aswin_teja
06-21-2005, 08:50 AM
thanx ! :thumbsup: im :D ;) on that ;) :thumbsup:
Secyrb
06-23-2005, 07:05 AM
Hi i started working with one of the codes i found on here and i entered all of my links to my media and it works in IE but not in firefox. I was wondering if someone could help me so it works in firefox and when my page starts up it will start playing a video automaticaly and then you can also select one from the drop down list thank you
PS i have to keep it html because myspace will not let you use java
<div align=center>
<SELECT id=cancion onchange=document.all.music.filename=document.all.cancion.value; size=1 name=Music>
<OPTION selected>::::::::::::: Choose Your Video Here :::::::::::::</OPTION>
<OPTION value=http://song.musicvideocodes.com/song.php?s=2772>The Thrillers - Big Sur</OPTION>
<OPTION value=http://song.musicvideocodes.com/song.php?s=2948>Gorillaz - Feel Good Inc.</OPTION>
<OPTION value=http://x1.musicvideocodes.com/38//8107213155.asf>Beastie Boys - Ch-Check It Out</OPTION>
<OPTION value=http://song.musicvideocodes.com/song.php?s=185>Beastie Boys - Body Movin</OPTION>
<OPTION value=http://song.musicvideocodes.com/song.php?s=761>Yellow Card - Only One</OPTION>
<OPTION value=http://song.musicvideocodes.com/song.php?s=763>Yellow Card - Way Away</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=265 width=320 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">
<embed src="-1" width="320" height="265" autostart="-1" balance="0" displaysize="0" filename="" mute="0" selectionstart="-1" selectionend="-1" showcontrols="-1" showaudiocontrols="-1" showdisplay="0" showpositioncontrols="-1" volume="0" audiostream="-1" autosize="0" animationatstart="-1" allowscan="-1" allowchangedisplaysize="-1" autorewind="1" baseurl="" bufferingtime="5" captioningid="" clicktoplay="-1" cursortype="0" currentposition="-1" currentmarker="0" defaultframe="" displaybackcolor="0" displayforecolor="16777215" displaymode="0" enabled="-1" enablecontextmenu="-1" enablepositioncontrols="-1" enablefullscreencontrols="0" enabletracker="-1" invokeurls="-1" language="-1" playcount="1" previewmode="0" rate="1" samilang="" samistyle="" samifilename="" sendopenstatechangeevents="-1" sendwarningevents="-1" senderrorevents="-1" sendkeyboardevents="0" sendmouseclickevents="0" sendmousemoveevents="0" sendplaystatechangeevents="-1" showcaptioning="0" showgotobar="0"" showstatusbar="0" showtracker="-1" transparentatstart="-1" videoborderwidth="0" videobordercolor="0" videoborder3d="0" windowlessvideo="0"></embed>
</OBJECT>
</div>
bhavman2
06-24-2005, 05:23 AM
i am using myspace.....which allows only html and ccs no javascript.....i want to have a drop down list that would let the viewer choose a video to play and i also want to have a video auto start once the website has loaded.....if anyone has a solution...i will be thankful... :)
_Aerospace_Eng_
06-24-2005, 06:37 AM
@Secryb Use this
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" width="300" height="300"
src="" autostart="true" loop="true">
You can't use the one with the drop down menu because it uses javascript.
@bhavman2 same with you, you can't use the one with the drop down menu because it has javascript in it sorry.
Secyrb
06-24-2005, 06:52 AM
But is there any way that you could choose a video to play from any sort of list or menu??
enumerator
06-24-2005, 08:32 AM
Link an iframe to load a new document (object/src) for each item...
numanme
06-25-2005, 03:28 AM
Been playing with this Media Player code for sometime now this is what I have done all I need now is the code to stop Play with a JPG or Gif button can anyone help
Click on this link and look for the media player top right hand corner
click here (http://homepage.ntlworld.com/richard.churchward/numanme/home.htm)
got the stop button working
_Aerospace_Eng_
06-25-2005, 03:37 AM
in Internet Explorer only right?
numanme
06-26-2005, 02:56 AM
Yes only in Internet Explorer love to get it working in Firefox
Secyrb
06-26-2005, 07:04 PM
Link an iframe to load a new document (object/src) for each item...
How do i do that All i want to do is be able to use html to choose from multiple music videos and play them
_Aerospace_Eng_
06-26-2005, 07:43 PM
You wouldn't be able to use the drop down menu because it would require javascript. Most you can do is make a page for each song having the embedded player on each page. Then make an iframe give the iframe a name and set the target of the links to the iframe name. The link would be the link to the pages you made.
Secyrb
06-26-2005, 07:52 PM
So... your saying they would each open on a seperate page..?? i can use flash like on this site but i dont know how to make it so it would play videos thanks to all of your your such a help!!!
_Aerospace_Eng_
06-26-2005, 07:55 PM
Yes you would need a seperate page for each video. If you want to use a drop down menu like in the examples here you would have to find a different place for your site.
Secyrb
06-26-2005, 08:05 PM
In this flash player you can use it on myspace and i have enough ftp sites to upload whatever i want but i guess what i am asking now is how do i make a flash video player with a list of videos that you can choose from?
Secyrb
06-26-2005, 08:07 PM
sorry i forgot to paste the site "http://www.atgig.com/Chasebadkids/" its on the right hand side umm about half the way down
_Aerospace_Eng_
06-26-2005, 08:14 PM
I'm not too good with flash. Check out www.flashkit.com you might be able to find something.
Secyrb
06-26-2005, 08:32 PM
ok.. well do you know of any cool mp3 players that u can use like on any website?
_Aerospace_Eng_
06-26-2005, 08:41 PM
That one was cool. You can even download it. I couldn't get it to work though, you might have better luck.
numanme
06-26-2005, 11:28 PM
try this one
click here (http://liyanekim.izlenim.com/flash.asp?thisMenu=8&thisMovie=player3.0)
Secyrb
06-26-2005, 11:42 PM
Hey thanks yeah i got that first one to work but i kinda wanted to make my own sorta like a flash list like the first one but to go along with my myspace "http://www.myspace.com/secyrb"
TritonWebStudio
06-27-2005, 08:36 PM
I'm new to CF, but have been reading this thread intently looking for an answer, but couldn't find it. Is there a way to show WMP's playlist screen inside the player, or do you have to code it in outside (as in the examples with the drop downs)? Thanks in advance
_Aerospace_Eng_
06-27-2005, 08:38 PM
That is correct, you have to show it outside of the player, you can't show it inside the actual player.
TritonWebStudio
06-27-2005, 08:41 PM
Thats what I thought. Thanks :)
Secyrb
06-28-2005, 02:05 AM
Hi i have been working on this flash media player for myspace and i have fiddled around with it but i cant seem to get it to work on myspace i have the html code and everything to put it in and then when i put the html in the myspace it comes up with a white screen and two codes above and below the white box? i was wondering if anybody could help me
_Aerospace_Eng_
06-28-2005, 08:52 AM
what flash media player? You are in the wrong topic. This is about Windows Media Player. Where did you get the flash player and what code did you use to put it on your myspace page.
Secyrb
06-29-2005, 06:34 AM
http://www.*******************/?item=Flash+MP3+Player&start=20#rc i got it there and when u download it i used the html code to put it on my myspace and u can see what i am talking about on http://www.myspace.com/secyrb
_Aerospace_Eng_
06-29-2005, 07:31 AM
Okay you cannot use an iframe to put flash on a page. But myspace seems to be stripping the object tags, so you need to use the embed tag only.
Secyrb
06-29-2005, 08:27 AM
how would i do that??
_Aerospace_Eng_
06-29-2005, 09:30 AM
Okay look half these answers are staring at you in the face. If it were a snake it would bite you. You said you used some html to put the flash onto your page. Did you not also see an embed tag in there as well? It also seems like you are linking to a page and not a flash file.
Secyrb
06-29-2005, 07:52 PM
No i download the flash player and well here is what i did i downloaded the player and it came with a playlist a flash file and a html document that when u open it u can use the flash file. I put that html code into my myspace and then i t just comes up with a white box what i am asking is how do i get the flash player that i uploaded via ftp onto my myspace with a embedded code or somthing??
_Aerospace_Eng_
06-29-2005, 09:50 PM
Really do a search on how to put flash on a page next time. Its been asked a countless number of times.
<embed src="yourflash.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="32" height="32"></embed>
Adjust the widths and height as necessary. You will need an offsite host for the playlist. You are on your own for that one.
bubbisthedog
07-17-2005, 01:30 AM
:thumbsup: Great thread, guys.
I understand how to get a song to play when a user clicks a lhyperlink ink in an embedded WMP <OBJECT> tag (setting the appropriate parameter), but how do you do it in an <EMBED> tag?
Thanks!
EDIT: What I mean is... When a link is clicked now, the Media Player does not play it unless the Play button is clicked. There's a parameter in <OBJECT> that forces this; is there an attribute in <EMBED> that does?
EDIT 2: BTW, it seems to play automatically in Firefox, but not IE??? Here's what I have:
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='280' height='69' controltype='2' showcontrols='1' showstatusbar='1' AutoStart='false'></embed>";
}
//-->
</script>
Body...
<embed type="application/x-mplayer2" id="music1"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
src=""
name="plamus"
width="280"
height="69"
controltype="2"
showcontrols="1"
showstatusbar="1"
AutoStart="0">
</embed>
EDIT 3: I suppose I could've posted a sample of the link...
<a href="source/pseudosong.wma" onclick="document.all.plamus.filename='source/pseudosong.wma';return false">listen</a>
bubbisthedog
07-17-2005, 08:45 PM
Okay, I changed Autostart 'head' from false to true and Autostart 'body' from 0 to 1, and now clicking my link starts the embedded media player in IE 6.0 (like I want it to)??? I thought Autostart was just supposed start playing a source (src) file upon opening a page??? There's obviously more to that parameter that I'm not getting...
None of my links play in Firefox, of course, except for some items in a drop-down list. I must have something seriously messed up. :eek: hahahahaha Either that, or I'm just falling victim to proprietorship.
Regards,
bubbis
_Aerospace_Eng_
07-17-2005, 10:18 PM
Try this
<!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>
<script type="text/javascript">
<!--
function PlayIt(thesong){
document.getElementById("music1").innerHTML='<object id="mediaPlayer" width="300" 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="'+thesong+'">'
+'<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/" '
+'showcontrols="true" width="300" height="45" '
+'src="'+thesong+'" autostart="true" loop="true">'
+'</embed>'
+'</object>'
}
//-->
</script>
</head>
<body>
<a href="http://urltosomesong.mp3" onclick="PlayIt(this.href);return false">Play this song</a>
<span id="music1">
<object id="mediaPlayer" width="300" 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="">
<param name="autoStart" value="false">
<param name="showControls" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" width="300" height="45"
src="" autostart="false" loop="true">
</object>
</span>
</body>
</html>
The problem you were having is you couldn't write html inside of an embed tag, so you need a container for the object/embed code hence why I used a span with id="music1", and you were also using IE only javascript in your links.
bubbisthedog
07-17-2005, 11:47 PM
Thanks a lot for taking the time to do that, man. :thumbsup: Works perfectly after some minor modifications. Those mistakes that I made were due to my inexperience with this scripting language.
Thanks again for helping me, Aerospace.
bubbisthedog
07-18-2005, 04:17 AM
Not sure if this was mentioned anywhere in this enormous thread...
You can use one embedded player that responds to hyperlinks and drop-down menus. For the latter, it's a very similar method to the one that the very generous Aerospace provided:
<form>
<table>
<tr align="center">
<td><b>streams>>></b></td>
<td>
<select onChange="PlayIt(this.options[this.selectedIndex].value);" size="1">
<option value="none">select album</option>
<option value="playlist1.m3u">impassive</option>
<option value="playlist2.m3u">fair & sight mindless</option>
</select>
</td>
</tr>
</table>
</form>
Notice the part highlighted in red; this differs from how you'd accomplish this with hyperlinks in an '<a>' tag:
onClick="PlayIt(this.href);"
Refer to Aerospace's code that he provided for me below for the PlayIt() function. Remember that by using the onChange method above, along with the code that Aerospace provided, the embedded media player will play either one of your clicked hyperlinks, or a selection that you make out of a drop-down list containing either songs or .m3u playlists.
If I made any boo-boos, please inform me.
Regards,
bubbis
aaroncavanaugh2
07-18-2005, 09:54 PM
Hi,
I need some help. Is there anyway to make windows media player preload the entire file before playback?
Here's what I have.
<object
classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6"
name=WindowsMediaPlayer1 id=WindowsMediaPlayer1 width=245 height=64>
<param name=URL value="radiofolder/current/radio.m3u">
<param name=rate value=1>
<param name=balance value=0>
<param name=currentPosition value=0>
<param name=defaultFrame value="">
<param name=playCount value=1>
<param name=autoStart value=-1>
<param name=currentMarker value=0>
<param name=invokeURLs value=-1>
<param name=baseURL value="">
<param name=volume value=50>
<param name=mute value=0>
<param name=uiMode value=full>
<param name=stretchToFit value=0>
<param name=windowlessVideo value=0>
<param name=enabled value=-1>
<param name=enableContextMenu value=0>
<param name=fullScreen value=0>
<param name=SAMIStyle value="">
<param name=SAMILang value="">
<param name=SAMIFilename value="">
<param name=captioningID value="">
<param name=enableErrorDialogs value=0>
<param name="_cx" value=6482>
<param name="_cy" value=1693>
I am using a different version of the plugin
Thanks. God Bless.
Aaron.
bubbisthedog
07-19-2005, 01:58 AM
Hello, Aaron. :)
Just curious: Why would you want the entire playlist loaded if you can have it continuously play one song after another (loading one after another)? How would you flip through songs? That method would also put a load on one's cache.
Regards,
bubbis
_Aerospace_Eng_
07-19-2005, 02:20 AM
Aaron, what you want to do is only possible if the server you are using is setup for streaming. You can do something similar by using flash, which plays the file while it loads. Check out this flash mp3 player http://www.*******************/?item=Flash+Mp3+Player
Integrated-Tech
07-19-2005, 04:33 AM
I think this thread will solve my problem.
Not new to forums, but new here. I have combed the web, other forums and this thread. I did find some useful information in this thread. Let me explain what I have been trying to do for the last three days until 3am....
I have a family page on my website(ours is geographically challenged). I am trying to place 3 video files only to have the following happen:
(I'm running my own tower)
In IE:
1) With all three players on the screen, when you push play on one, it will play it in one of the other players.
2) I'm using <iframe> to include each video clip and it freezes my browser (IE, FF & Opera) in or out of https://
3) When I play more than one video clip it plays it in the SAME player.
In FF:
1) Shows the player, won't play video clip.
2) Freezes the browser
Is this a server issue? I'm using a simple 350 kb .mpg file.
Here is my main page code that includes my <iframe> (PLEASE forgive the table...I normally design in tables then transfer the presentation to CSS last):
<tr>
<td><iframe src="movies/001.html" frameborder="1" width="171" height="135" marginheight="2" marginwidth="2" scrollong="no">
</iframe>
</td>
<td><iframe src="movies/002.html" frameborder="1" width="171" height="135" marginheight="2" marginwidth="2" scrollong="no">
</iframe>
</td>
<td><iframe src="movies/003.html" frameborder="1" width="171" height="135" marginheight="2" marginwidth="2" scrollong="no">
</iframe>
</td>
</tr>
Here is my <iframe> .html file (same for all three video clips):
<embed type="application/x-mplayer2" pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" width="165" height="130" src="001.mpg" autostart="false">
</embed>
Any suggestions would be greatly appreciated!
Thank you for helping me lear...
Gratefully Yours,
Integrated-Tech
TinmanIII
07-19-2005, 05:13 AM
I have read this whole section of the forum plus all these pages, I think my problem has not been covered, although, I have learned some interesting stuff along the way.
I would appreciate some help on this one.
I wish to send "commands" ( play, next, etc) into my iframe which as the wmp.
This is what i have:
index page with
<iframe name="sample" src="just_background.htm" title="sampleiframe" height="300" width="500" align="center" border="0" frameborder="0">
Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe>
I have a link to load the iframe with WMP :
<A HREF="music.htm" TARGET="sample">play music</a>
now within "music.htm" i have a button to start playing my playlist,
(using some JS)
<script type="text/javascript">
function startPlayback(){
document.WindowsMediaPlayer1.controls.play();
}
function fullscreen(){
document.WindowsMediaPlayer1.controls.fullscreen();
}
function uiMode(){
document.WindowsMediaPlayer1.controls.full();
}
</script>
<INPUT type = button
value = "play"
name = FSBUTTON
onclick = "
WindowsMediaPlayer1.controls.play();
">
Everything works, but my problem is:
I want the WindowsMediaPlayer1.controls.play(); function sent from my index page to the iframe (music.htm with wmp in it), and I just can't figure that one out, I have tried myself, googled and wmp10 sdk and i'm basically stuck.
I do have the JS on the index page as well as the music.htm
All I need is the "button" ( on the index page) to send the play function to the iframe "music.htm"
can anyone help please, I thank you in advance,
Ryan
_Aerospace_Eng_
07-19-2005, 05:18 AM
@Integrated-Tech Why are you using an iframe for each player? It shouldn't freeze the browser unless your mpg is messed up. Try this Embedded Media Player Generator (http://cit.ucsf.edu/embedmedia/step1.php). It could be a plugin issue. What I have done on my site was play the videos in the player by clicking on a link. This prevents FF from making the video autostart. Can you provide a link to your page so I can do some testing?
@TinmanIII I'll use your play function as an example. You have to access the iframe, to do this you will have to give the iframe a name which you already have.
On your buttons, the onclick should have parent.theiframename. before the function
<a href="#" onclick="parent.sample.startPlayback();return false">Play</a>
Integrated-Tech
07-19-2005, 05:35 AM
OF course...sorry...
Using iframe to try to keep the players from communication with each other.
Although the same things happen as in my previous post when I don't use iframe as well.
My Site (http://integrated-technologies.us)
(Please don't heckle my mark-up...still in the designing phase)
Use the following Username and Password:
_Aerospace_Eng_
07-19-2005, 06:12 AM
Okay using this code
<object width="165" height="130"
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="003.mpg">
<param name="animationatStart" value="true">
<param name="transparentatStart" value="true">
<param name="autoStart" value="false">
<param name="showControls" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true"
showdisplay="0" showstatusbar="1" width="165" height="130"
src="003.mpg" autostart="false" loop="true">
</embed>
</object>
on the same page as 2 other codes similar it works fine in IE. Firefox however I believe requires quicktime in order to play .mpg files. If you can convert it to a wmv it should play. Maybe you can some how give the option to choose which player to use.
Integrated-Tech
07-19-2005, 06:23 AM
Correct...FF/NS does need QT to play .mpg files.
Great idea! a simple graphic as a standby with a radio for visitors to choose which version they'd like to play.
<<< Sincerely grateful for your guidance tonight....
Gratefully yours,
Integrated-Tech
bubbisthedog
07-19-2005, 06:34 AM
Aerospace...
Where do you find a complete listing of all possible parameters for this embedded media player? I'm guessing it's on MSDN, but I can't seem to locate it for some reason...
Thanks for your continued support on this,
bubbis
_Aerospace_Eng_
07-19-2005, 06:43 AM
Aerospace...
Where do you find a complete listing of all possible parameters for this embedded media player? I'm guessing it's on MSDN, but I can't seem to locate it for some reason...
Thanks for your continued support on this,
bubbis
You might be able to find it here (http://www.microsoft.com/windows/windowsmedia/default.aspx). Not sure if its changed or not. I don't use too many parameters only because most of them aren't needed so it clogs up the code a bit.
bubbisthedog
07-19-2005, 07:10 AM
Cool beans, gracias.
bubbisthedog
07-19-2005, 08:56 PM
Hello, Aaron. :)
Just curious: Why would you want the entire playlist loaded if you can have it continuously play one song after another (loading one after another)? How would you flip through songs? That method would also put a load on one's cache.
Regards,
bubbis
Another thing, Aaron (this applies if you've hired an outfit to host your server):
If you chose to use WMP over Flash, and wanted someone to load one giant playlist all at once, check with your host to see what the maximum download size per month is. Mine is 50 G, I think. So, if someone were to load up a giant playlist like that, and only listen to the first 10 Meg (out of 100 Meg, let's say), that'd be 90 Meg off your allowance for the month.
I think that's how it works anyway... Just letting you know...
Regards,
bubbis
TinmanIII
07-20-2005, 03:51 AM
Thanks Aerospace Eng,
I'll try that, I was missing "parent." in my trials,
thanks again.
Ryan
@Integrated-Tech Why are you using an iframe for each player? It shouldn't freeze the browser unless your mpg is messed up. Try this Embedded Media Player Generator (http://cit.ucsf.edu/embedmedia/step1.php). It could be a plugin issue. What I have done on my site was play the videos in the player by clicking on a link. This prevents FF from making the video autostart. Can you provide a link to your page so I can do some testing?
@TinmanIII I'll use your play function as an example. You have to access the iframe, to do this you will have to give the iframe a name which you already have.
On your buttons, the onclick should have parent.theiframename. before the function
<a href="#" onclick="parent.sample.startPlayback();return false">Play</a>
Mrdzone
07-20-2005, 08:03 PM
So i've embedd wmp10 into an hta application which starts showing a wmv. For layout reassons I had to specify a width and height for WMP. Therefore when the user decides to click on a song (i have a drop down box with the selections) they are presented a black screen above the wmp controls (i want to show the controls) my question is this: is there anyway to show a visualization or picture in that black space? Right now i have it working by using style sheets and giving the wmp a zindex of -1 and overlaying a picture/slideshow over just the black portion, but i'm wondering if there's a cleaner way of doing this, and ideally to put a visualization in that window.
Thanks for any help,
Bob
_Aerospace_Eng_
07-20-2005, 08:25 PM
The visualization will only work in Internet Explorer. Add this param to your object code.
<param name="uiMode" value="full">
You shouldn't have to specify anything else unless you want to the full mode takes care of most of the items you need. Since IE goes off of the object tag, you can make the embed tag smaller for those people who can't see the visualization because these are usually the browsers that use the embed tag.
codemiester187
07-27-2005, 09:02 AM
To the guy, who last replied to this posting I was wondering if there was a way to take the bar out that shows the file path ..?
If that can't be done then don't worrie about it
_Aerospace_Eng_
07-27-2005, 07:57 PM
Show me the code you are using. Parameters are different dependent upon what classid you are using.
Hi,
This is a very helpful post.
I have a question (sorry if it has been answered before).
Is it possible to have one code to play different files eg, mp3, wmv, rm, ram, mov. If someone chooses a real player file from the drop down menu, then real player will load. And if someone chooses a mov file, then quicktime will load in place of real player....
Currently I am using this code for media player files.
Is it possible? Thanks. I hope I made my question clear.
<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>
Any help with my query above. Thank you.
cdrbond007
08-09-2005, 01:28 AM
I have been trying to catch up on this thread, but I am a noob and easily confused with this stuff. I am trying to do something simple, but I need help. What I want is one frame with a list of videos, and the other frame with an embedded media player. When you click on a video link, it plays on the media player in the other frame. The page is complete with frames, etc. I just don't understand how to embed the media player or get it to play the video clips from the other frame. Any help would be greatly appreciated!
P.S. Is there any way to do this without using Javascript?
_Aerospace_Eng_
08-09-2005, 01:52 AM
No there is no way to do this without javascript. If you cant use javascript let me know now so I don't go wasting time marking up the script for you.
cdrbond007
08-09-2005, 02:02 AM
I can use it, I'm just not really familiar with it. Would it be easier if I sent you a very simplified version of my webpage? Then you could just add the script in that is needed.
edit: I attached the files in a zip; the page with the media player may need to be changed. (I put a small picture in just for reference). Thanks!
_Aerospace_Eng_
08-09-2005, 04:30 AM
Here you go.
UnrealSem
08-09-2005, 09:25 PM
Is there an attribute to make a playlist visible in the media player so that a song can be selected from the list instead of having to click the thext track button?
Hi _Aerospace_Eng_,
Can you help me with my question which I posted earlier. Here is the link:
http://www.codingforums.com/showpost.php?p=340766&postcount=149
Thanks.
cdrbond007
08-09-2005, 10:22 PM
THANK YOU!!! That is EXACTLY what I was looking for. You are da man :thumbsup:
_Aerospace_Eng_
08-10-2005, 02:19 AM
Is there an attribute to make a playlist visible in the media player so that a song can be selected from the list instead of having to click the thext track button?
No if you want to do this then you'll need a player that is more verbose. Check out this flash player (http://www.*******************/?item=Flash+Mp3+Player).
UnrealSem
08-10-2005, 04:24 AM
No if you want to do this then you'll need a player that is more verbose. Check out this flash player (http://www.*******************/?item=Flash+Mp3+Player).
do you know of any players that are a bit more compact? Or size ajustable? Thanx alot man!
_Aerospace_Eng_
08-10-2005, 06:23 AM
do you know of any players that are a bit more compact? Or size ajustable? Thanx alot man!
What you could do is look for the player on here that uses a select menu its in this thread somewhere, and add multiple="#" where # is what ever number of songs you want to display at a time or you could just use the default and allow the user to use the drop down menu to pick their song, it won't play in order, but you could set it up that way by making a bunch of m3u playlists, there is tutorial on how to do that also in this thread.
UnrealSem
08-10-2005, 07:46 AM
i need something that will work on myspace...that one you posted earlier was awsome but it won't work on myspace...did everything i could and then i read the posts on the site and he said that he can't get it to work on it! Know of anything else?
_Aerospace_Eng_
08-10-2005, 09:06 AM
Okay then no the javascript won't work but the flash player I linked you to will work on myspace see (http://www.myspace.com/secyrb).
UnrealSem
08-10-2005, 11:49 AM
wow, when i did it it just said it couldn't find the xml file...but i did everything right....Is that your profile? If so could you send me the code you used, cause i used the code that came in the readme and it didn't work properly!
_Aerospace_Eng_
08-11-2005, 06:49 AM
No its not my profile, I referred them to the same flash player that I referred you to. They got it to work. You'll need to edit the .fla file if you can, or tell me where you are hosting your xml file and I will edit the .fla file for you.
UnrealSem
08-11-2005, 09:25 AM
i figured it out...there was a tutorial somewhere and basically all i needed to do was use tinyurl.com to shorten he length of the url to the swf file...works great now! Thanx alot, you really know your stuff!
aaroncavanaugh2
08-15-2005, 02:52 AM
Another thing, Aaron (this applies if you've hired an outfit to host your server):
If you chose to use WMP over Flash, and wanted someone to load one giant playlist all at once, check with your host to see what the maximum download size per month is. Mine is 50 G, I think. So, if someone were to load up a giant playlist like that, and only listen to the first 10 Meg (out of 100 Meg, let's say), that'd be 90 Meg off your allowance for the month.
I think that's how it works anyway... Just letting you know...
Regards,
bubbis
Hi bubbisthedog,
I don't want to load the whole playlist just each song before it plays back.
The reason is this it will play the first file fine then moves onto the second and doesn't download the song entirely before it plays it back therefore it only plays part of the song then skips to the next song. Really weird. The media player will play every other song fine, but every other song only downloads part way.
I makes the playlist hard to listen to.
That flash player isn't going to work it doesn't support m3u files.
In effect Aerospace_Eng what I want it to do is wait a couple seconds (so it can preload) before it plays back.
btw I don't have a streaming server.
all my files are 32k mp3 3 megs or less. I connect with a highspeed cable connection. Apparently on the songsit doesn't download all the way it stops at a %17 and stops downloading then on the songs it does download you see example 9%, 17%, 45% etc.
www.christianradio.me.uk - click on the listen link
Here's what I have.
<object
classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6"
name=WindowsMediaPlayer1 id=WindowsMediaPlayer1 width=245 height=64>
<param name=URL value="radiofolder/current/radio.m3u">
<param name=rate value=1>
<param name=balance value=0>
<param name=currentPosition value=0>
<param name=defaultFrame value="">
<param name=playCount value=1>
<param name=autoStart value=-1>
<param name=currentMarker value=0>
<param name=invokeURLs value=-1>
<param name=baseURL value="">
<param name=volume value=50>
<param name=mute value=0>
<param name=uiMode value=full>
<param name=stretchToFit value=0>
<param name=windowlessVideo value=0>
<param name=enabled value=-1>
<param name=enableContextMenu value=0>
<param name=fullScreen value=0>
<param name=SAMIStyle value="">
<param name=SAMILang value="">
<param name=SAMIFilename value="">
<param name=captioningID value="">
<param name=enableErrorDialogs value=0>
<param name="_cx" value=6482>
<param name="_cy" value=1693>
I am using a different version of the plugin
Thanks. God Bless.
Aaron.
jason123
08-15-2005, 03:07 AM
is there a way where i can let the user decide which file to play using links taken from database (not hardcoded in html ) and after the user had click on the selected link, the song will be played in media player in another page? Have been trying how to get the filename and place it in the html tag, can someone advice me on that.
Ed McP
08-15-2005, 04:22 AM
I have embeded one windows media player into my webpage and have given vistors links to play any number of videos in the single player. However the links don't consistently go to the player. Occasionaly an external windows media player will open and the embeded player stays quiet. Also, on occasion both will begin to play. Anyone had this problem before?
http://www.geocities.com/idiged//links.htm
many thanks
mia27
08-19-2005, 03:59 AM
Okay, so I went to the site and got the flash player. It works, all is good in the world. Except one thing -- I put it into my blogger html template, and I can't move it... like, to a different area of the page. It's behind a picture and under my journal post. I was told that if I put it in a table or something I could move it, but I'm superdumb and don't know how to do that. Soooooo... if it's possible, could someone explain it? And if not, could someone tell me what I could do? Thanks muchly <3.
_Aerospace_Eng_
08-20-2005, 02:41 AM
@aaroncanavnaugh2 and jason123 I will refer you to this flash mp3 player (http://www.*******************/?item=Flash+Mp3+Player) which does load the song while the song is playing so technically its streaming and it can also be setup to read songs from a database.
@mia27 what flash player did you get, and when you say can't move it you mean can't drag it with the mouse or you don't know how to put it in a certain spot on your page? Without your code its impossible to give you a valid solution.
PS aaron in the future please don't PM just to get me to look at your problem. I am NOT the only member on the forums. Just be patient and your question will be answered if its a topic of interest in due time.
brentk711
09-08-2005, 06:17 PM
I have read this entire post and havent found an answer to what I'd like to do.
I have an embedded wmp in my page and want to have a link or button to allow the viewer to go to fullscreen AND not open a separate WMP window. Also wish for it to resume where it was playing. When pressing ESC or double clicking it closes the fullscreen and returns to original html page. CBSnews.com does this and I like it!
If any can help out i would truly appreciate it! Yes, I'm new to Javascript.
Basic pages to test this so far:
index2.html:
-----------------------------
<HTML>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Paul Deron (trombonepaul@yahoo.com) -->
<!-- Web Site: http://paul1.web.com -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function fullScreen(theURL) {
window.open(theURL, '', 'fullscreen=yes, scrollbars=auto');
}
// End -->
</script>
</head>
<BODY>
<center>
<OBJECT
ID="WinMedia"
classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
CODEBASE=
"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1
,52,701" width=480 height=435 standby="Loading Microsoft Windows Media Player
components..." type="application/x-oleobject">
<PARAM NAME="AudioStream" VALUE="-1">
<PARAM NAME="AutoSize" VALUE="-1">
<PARAM NAME="AutoStart" VALUE="1">
<PARAM NAME="AnimationAtStart" VALUE="-1">
<PARAM NAME="AllowScan" VALUE="-1">
<PARAM NAME="AllowChangeDisplaySize" VALUE="-1">
<PARAM NAME="AutoRewind" VALUE="0">
<PARAM NAME="Balance" VALUE="10">
<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="65535">
<PARAM NAME="DisplayForeColor" VALUE="16744448">
<PARAM NAME="DisplayMode" VALUE="0">
<PARAM NAME="DisplaySize" VALUE="2">
<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="video.asx">
<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="-1">
<PARAM NAME="ShowGotoBar" VALUE="0">
<PARAM NAME="ShowPositionControls" VALUE="-1">
<PARAM NAME="ShowStatusBar" VALUE="-1">
<PARAM NAME="ShowTracker" VALUE="-1">
<PARAM NAME="TransparentAtStart" VALUE="0">
<PARAM NAME="VideoBorderWidth" VALUE="5">
<PARAM NAME="VideoBorderColor" VALUE="4227327">
<PARAM NAME="VideoBorder3D" VALUE="0">
<PARAM NAME="Volume" VALUE="-150">
<PARAM NAME="WindowlessVideo" VALUE="0">
<Embed type="application/x-mplayer2"
pluginspage=
"http://www.microsoft.com/Windows/MediaPlayer/"
src="video.asx"
Name=MediaPlayer
AutoStart=0
Width=480
Height=435
autostart=1
ShowControls=1
</embed>
</OBJECT>
<a href="javascript:void(0);" onClick="fullScreen(video.asx);return false">Open
Full Screen Window</a>
<br>
<a href="javascript:void(0)" onclick="full(video.asx);return false"
class="whitesmall">Fullscreen</a>
</center>
</BODY>
</HTML>
----------------------------------------------------------
video.asx:
<ASX version = "3.0">
<ENTRY>
<REF HREF =
"TC4014-V.wmv" />
</ENTRY>
</ASX>
----------------------------------------------------------
_Aerospace_Eng_
09-08-2005, 06:29 PM
Search around for play states for Windows Media Player. I haven't work with these before but its able to pause and start from where you want it to. It only works in IE though.
brentk711
09-08-2005, 06:34 PM
Thanks. The resume is probably way more involved and I can give up on that for now, but would like to be able to go to full screen and then back when done. I wouldnt think this would be too hard to do but I am not well versed in this.
_Aerospace_Eng_
09-08-2005, 07:32 PM
The doubleclick would be a bit harder as its not supported too well. The esc key is a different story. The popup page should be setup like this.
yourplayer.html
<!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>
function keyPressHandler(e) {
var kC = (window.event) ? // MSIE or Firefox?
event.keyCode : e.keyCode;
var Esc = (window.event) ?
27 : e.DOM_VK_ESCAPE // MSIE : Firefox
if(kC==Esc) window.close();
}
</script>
</head>
<body onkeypress="keyPressHandler(event)">
<!--Your Video Code Here-->
</body>
</html>
If the user hits esc the popup should close.
Then on the page that has the button, setup it up like this.
<!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>
<script type="text/javascript">
function openWin(url){
sw=screen.width;
sh=screen.height;
newwin=window.open(url,'newwin','width='+sw+',height='+sh+',top=0,left=0,scrollbars=0,menubars=0,too lbar=0');
}
</script>
</head>
<body>
<input type="button" value="Full Screen" onclick="openWin('yourplayer.html')">
</body>
</html>
brentk711
09-08-2005, 07:49 PM
Hey thanks, but that opens another html window and the media player is the same size.
Maybe I needed more explanation of what exactly I'm trying to accomplish.
I want the media player to open as if you Hit ALT-ENTER while playing a video. (full screen mode with contrtols if mouse moves) Then the control to close that window would be handled by WMP. ESC or Double-click closes WMP...
See CBSnews.com for an exact example of what I'd like to do.
Thanks for your time!
I looked at MSDN for the answer and the coded they gave is:
<INPUT type = button
value = "Full Screen"
name = FSBUTTON
onclick = "
/* Check to be sure the player is playing. */
if (Player.playState == 3)
Player.fullScreen = 'true';
">
----------------------------------
but IE gave an error "player" is undefined... yet the ID I used was "player"
_Aerospace_Eng_
09-08-2005, 07:55 PM
Umm yeah you have to actually tell the player to play fullscreen. Try this for the yourplayer.html page.
<!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">
<style type="text/css">
html, body {
height:100%;
margin:0;
padding:0;
overflow:hidden;
}
</style>
<script>
function keyPressHandler(e) {
var kC = (window.event) ? // MSIE or Firefox?
event.keyCode : e.keyCode;
var Esc = (window.event) ?
27 : e.DOM_VK_ESCAPE // MSIE : Firefox
if(kC==Esc) window.close();
}
</script>
</head>
<body onkeypress="keyPressHandler(event)">
<object id="mediaPlayer" width="100%" height="100%"
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="video.asx">
<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/"
showcontrols="true" width="100%" height="100%"
src="video.asx" autostart="true" loop="true">
</object>
</body>
</html>
You can use the msdn one but it will only work on IE. IE is not the only browser out there. Good luck capturing the alt enter. I don't know how to catpure two keys at once. I gave you the script to capture the escape key so maybe you can work from that.
brentk711
09-08-2005, 08:08 PM
wow... so close! Only it's still in an IE window. Also it's a floating window with the bottom and right side off the screen a tad. if you look at cbsnews.com you will see exactly what I am wanting. Its a true WMP window with all the controls and behavior of having a WMP open. I guess I could use this latest one you came up with but now I am very curious as to how they did this. :)
Thanks for all the help! you are good!
brentk711
09-08-2005, 08:30 PM
I have a feeling that if I can get this code to work it may be the answer to this?
<INPUT type = button
value = "Full Screen"
name = FSBUTTON
onclick = "
/* Check to be sure the player is playing. */
if (Player.playState == 3)
Player.fullScreen = 'true';
">
It doesnt work though.
more info from MSDN:
-----------------------------------------
During full-screen playback, Windows Media Player hides the mouse cursor when enableContextMenu equals false and uiMode equals "none".
If uiMode is set to "full" or "mini", Windows Media Player displays transport controls in full-screen mode when the mouse cursor moves. After a brief interval of no mouse movement, the transport controls are hidden. If uiMode is set to "none", no controls are displayed in full-screen mode.
Note Displaying transport controls in full-screen mode requires the Windows XP operating system.
If transport controls are not displayed in full-screen mode, then Windows Media Player automatically exits full-screen mode when playback stops.
-------------------------------------------
brentk711
09-08-2005, 08:31 PM
is this video.asx file the hangup? Maybe I dont even need it?
_Aerospace_Eng_
09-08-2005, 11:36 PM
The classid being used is for wmp8 and below the one you need is 6BF52A52-394A-11D3-B153-00C04F79FAA6
The asx probably not the problem, but you are right all you need is this TC4014-V.wmv
Note now almost all the parameters need to be changed.
<object id="mediaPlayer" width="100%" height="100%"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
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="url" value="TC4014-V.wmv">
<param name="uiMode" value="full">
<param name="autoStart" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" uimode="full" width="100%" height="100%"
src="video.asx" autostart="true" loop="true">
</object>
Before you say "but this doesnt work in Firefox" is your target audience using Internet Explorer?
brentk711
09-09-2005, 01:13 AM
I just noticed before reading your last reply I have been using 2 different classid's.
I have not tried your last post code yet. I have some questions first about what classid affects? reason I ask this is because I was trying to use your drop down list code you provided several posts earlier and my full screen stopped working. I did get this to work perfect before reading your last post and will share once I digest whats going on first. The one I believe you used in the prior post for the drop down list is : classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95
When I use the one that works with my full screen code (CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6) your drop down list doesnt work. Unless i am missing something.
Sorry, but I am trying to absorb alot at once here. :)
I will only be using this code for IE only, ,and locally.
Thanks for the super help!!
I almost have it all peiced together but this classid is maybe a hangup?
Also can the ID= be whatever you wish?
brentk711
09-09-2005, 01:58 AM
Your last code still opens a IE browser window.
Below is code that does exactly what I want except for it doesnt start automatically but I can work with that.
Got rid of the video.asx file also.
When I click the FULL button it opens a WMP window and ESC or double click closes it and returns to the HTML browser, AND the media file plays without interuption perfectly! :thumbsup: Finally! (Other buttons have wrong names but work too)
<HTML>
<HEAD>
</HEAD>
<BODY>
<OBJECT ID="Player" height="240" width="320"
CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
CODEBASE=
"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1
,52,701" width=320 height=240 standby="Loading Microsoft Windows Media Player
components..." type="application/x-oleobject">
<PARAM NAME="FileName" VALUE="tc4014-v.wmv">
<PARAM NAME="AutoStart" Value="true">
<PARAM NAME="ShowControls" Value="true">
<Embed type="application/x-mplayer2"
pluginspage=
"http://www.microsoft.com/Windows/MediaPlayer/"
src="tc4014-v.wmv"
Name=Player
AutoStart=1
Width=320
Height=240
autostart=1
ShowControls=1
</embed>
</OBJECT>
<INPUT TYPE="BUTTON" NAME="BtnPlay" VALUE="true" OnClick="StartMeUp()">
<INPUT TYPE="BUTTON" NAME="BtnStop" VALUE="Stop" OnClick="ShutMeDown()">
<INPUT TYPE="BUTTON" NAME="Btnfull" VALUE="FULL" OnClick="screenfull()">
<SCRIPT>
<!--
function StartMeUp ()
{
Player.URL = "tc4014-v.wmv";
}
function screenfull ()
{
/* Check to be sure the player is playing. */
if (Player.playState == 3)
Player.fullScreen = 'true';
}
function ShutMeDown ()
{
Player.controls.stop();
}
-->
</SCRIPT>
</BODY>
</HTML>
This code works alone and would like to add it to the above code so it works in unison. When I do this neither one works. :confused:
<html>
<body>
<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=s292.wma>Jon Courson - Song Title</OPTION>
<OPTION value=tc4014-v.wmv>Jon Couson Vid - 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=480 width=435 classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95>
<PARAM NAME="AudioStream" VALUE="-1">
<PARAM NAME="AutoSize" VALUE="-1">
<PARAM NAME="AutoStart" VALUE="TRUE">
<PARAM NAME="AnimationAtStart" VALUE="-1">
<PARAM NAME="AllowScan" VALUE="-1">
<PARAM NAME="AllowChangeDisplaySize" VALUE="-1">
<PARAM NAME="AutoRewind" VALUE="0">
<PARAM NAME="Balance" VALUE="10">
<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="65535">
<PARAM NAME="DisplayForeColor" VALUE="16744448">
<PARAM NAME="DisplayMode" VALUE="0">
<PARAM NAME="DisplaySize" VALUE="2">
<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="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="TRUE">
<PARAM NAME="ShowAudioControls" VALUE="-1">
<PARAM NAME="ShowDisplay" VALUE="-1">
<PARAM NAME="ShowGotoBar" VALUE="0">
<PARAM NAME="ShowPositionControls" VALUE="-1">
<PARAM NAME="ShowStatusBar" VALUE="-1">
<PARAM NAME="ShowTracker" VALUE="-1">
<PARAM NAME="TransparentAtStart" VALUE="0">
<PARAM NAME="VideoBorderWidth" VALUE="5">
<PARAM NAME="VideoBorderColor" VALUE="4227327">
<PARAM NAME="VideoBorder3D" VALUE="0">
<PARAM NAME="Volume" VALUE="-150">
<PARAM NAME="WindowlessVideo" VALUE="1">
pluginspage=
"http://www.microsoft.com/Windows/MediaPlayer/"
Name=MediaPlayer
AutoStart=0
Width=480
Height=435
autostart=1
ShowControls=1
</embed>
</OBJECT>
</div>
</body>
</html>
It's probably one of the parameters or the CLASSID. i tried different ones and still didnt get it to work. I'm sure it's simple but I'm not getting it.
I thought I could just add the code from above between the <SELECT> tags into the first code and have both work. Of course I changed this code
<SELECT id=cancion onchange=document.all.music.filename=document.all.cancion.value; size=1 name=Music>
TO: ("music" TO "player")
<SELECT id=cancion onchange=document.all.player.filename=document.all.cancion.value; size=1 name=Music>
_Aerospace_Eng_
09-09-2005, 05:33 AM
You are using the really outdated script. The classid tell the browser what media player to use therefore different parameters need to be used.
onchange=document.all.music.filename=document.all.cancion.value;
The above pulls the value from the select menu and places it in the url parameter. If you id of the player is music then leave this alone, if you changed the id then you would have to change the reference to music to whatever id you changed it to. You might want to put the name as well. Your current object code has an id of player so change this
onchange=document.all.music.filename=document.all.cancion.value;
to this
onchange="document.all.player.url=document.all.cancion.value;"
Again you are using the wrong classid for the parameters you are using. Use the last code I posted. Just add id="player" name="player" to it and it should work in conjuction with the select menu. I'm pretty sure IE needs the name to access the object.
brentk711
09-09-2005, 07:58 AM
please know I'm trying to figure this out without help... but still new to me. sorry.
I did try using the id= player and name = player. Will try again.
Secondly I am using CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6
which from all I can find on MSDN is the latest for WMP 10. Is this wrong?
The one you used for your drop down selection code is:
classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95
which I read is for WMP 6 or 6.4?
There are a LOT of PARAM's in your drop down code on the first page of this thread.
I'm only using 3 PARAM's for my Fullscreen code.
Not sure if your drop down PARAM's are all needed and suspect some are not compatible with the CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6?
Am i right?
_Aerospace_Eng_
09-09-2005, 08:12 AM
No they aren't all needed. If you indeed did read the whole thread you would know that I have trimmed my original to something less bulkier. Okay I am now repeating myself (something I don't like doing), some of the parameters that are in the original code will not work with the newest classid. Please refer the the most recent code I posted. It IS the media code you should use.
brentk711
09-09-2005, 08:54 AM
I'll try to sift through the 13 pages posted and figure it out. no prob.
Here is the combined code. The Full screen I was trying to accomplish works great. I guess I am trying to get too fancy with the drop down list. The drop down list doesnt do anything.
If it's painfully obvious please let me know what PARAM is missing or what I did wrong, otherwise I'll keep working on it until I figure it out.
thanks again!
<HTML>
<HEAD>
</HEAD>
<BODY>
<div align=center>
<SELECT id=cancion onchange=document.all.player.filename=document.all.cancion.value; size=1 name="player">
<OPTION selected>::::::::::::: Choose Your Song Here :::::::::::::</OPTION>
<OPTION value=s292.wma>Jon Courson - Song </OPTION>
<OPTION value=tc4014-v.wmv>Jon Couson - Video</OPTION>
</SELECT>
<BR>
<OBJECT ID="Player" height="240" width="320" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
CODEBASE= "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" width=320 height=240 standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
<PARAM NAME="AutoStart" Value="true">
<PARAM NAME="ShowControls" Value="true">
<Embed type="application/x-mplayer2"
pluginspage=
"http://www.microsoft.com/Windows/MediaPlayer/"
Name="Player"
AutoStart=1
Width=320
Height=240
ShowControls=1
</embed>
</OBJECT>
<br>
<INPUT TYPE="BUTTON" NAME="BtnPlay" VALUE="PLAY" OnClick="StartMeUp()">
<INPUT TYPE="BUTTON" NAME="BtnStop" VALUE="STOP" OnClick="ShutMeDown()">
<INPUT TYPE="BUTTON" NAME="Btnfull" VALUE="FULL" OnClick="screenfull()">
<SCRIPT>
<!--
function StartMeUp ()
{
Player.URL = "tc4014-v.wmv";
}
function screenfull ()
{
/* Check to be sure the player is playing. */
if (Player.playState == 3)
Player.fullScreen = 'true';
}
function ShutMeDown ()
{
Player.controls.stop();
}
-->
</SCRIPT>
</div>
</BODY>
</HTML>
_Aerospace_Eng_
09-09-2005, 09:19 AM
Read post #183 I told you what to change. Add
<PARAM NAME="URL" VALUE="">
to your object code.
brentk711
09-09-2005, 06:13 PM
ok, sorry i missed that change. Now the buttons to start, stop, and fullscreen work but the drop down list doesnt do anything.
sorry for being a pest...I'm trying to learn all this
appreciate your help!
<HTML>
<HEAD>
</HEAD>
<BODY>
<div align=center>
<SELECT id=cancion onchange="document.all.player.url=document.all.cancion.value;"
size=1 name="player">
<OPTION selected>::::::::::::: Choose Your Song Here :::::::::::::</OPTION>
<OPTION value=s292.wma>Jon Courson - Song </OPTION>
<OPTION value=tc4014-v.wmv>Jon Couson - Video</OPTION>
</SELECT>
<BR>
<OBJECT ID="Player" height="240" width="320"
CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
CODEBASE=
"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1
,52,701" width=320 height=240 standby="Loading Microsoft Windows Media Player
components..." type="application/x-oleobject">
<PARAM NAME="URL" VALUE="">
<PARAM NAME="AutoStart" Value="true">
<PARAM NAME="ShowControls" Value="true">
<Embed type="application/x-mplayer2"
pluginspage=
"http://www.microsoft.com/Windows/MediaPlayer/"
Name="Player"
AutoStart=1
Width=320
Height=240
ShowControls=1
</embed>
</OBJECT>
<br>
<INPUT TYPE="BUTTON" NAME="BtnPlay" VALUE="PLAY" OnClick="StartMeUp()">
<INPUT TYPE="BUTTON" NAME="BtnStop" VALUE="STOP" OnClick="ShutMeDown()">
<INPUT TYPE="BUTTON" NAME="Btnfull" VALUE="FULL" OnClick="screenfull()">
<SCRIPT>
<!--
function StartMeUp ()
{
Player.URL = "tc4014-v.wmv";
}
function screenfull ()
{
/* Check to be sure the player is playing. */
if (Player.playState == 3)
Player.fullScreen = 'true';
}
function ShutMeDown ()
{
Player.controls.stop();
}
-->
</SCRIPT>
</div>
</BODY>
</HTML>
_Aerospace_Eng_
09-09-2005, 09:47 PM
Your main problem was your select menu was also named player so it was conflicting with the object code. Here you go, the buttons work, the drop down menu works.
<!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>
<script type="text/javascript">
<!--
function StartMeUp(){
player.url = "tc4014-v.wmv";
}
function screenfull(){
/* Check to be sure the player is playing. */
if (player.playState == 3)
player.fullScreen = 'true';
}
function ShutMeDown(){
player.controls.stop();
}
function PlayIt(){
document.player.url=document.getElementById('cancion').value;
}
//-->
</script>
</head>
<body>
<select name="cancion" id="cancion" onchange="PlayIt()">
<option value="none">::::::::::::: Choose Your Song Here :::::::::::::</option>
<option value="s292.wma">Jon Courson - Song </option>
<option value="tc4014-v.wmv">Jon Couson - Video</option>
</select><br>
<span id="music">
<object id="player" name="player" width="240" height="320"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
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="url" value="">
<param name="uiMode" value="full">
<param name="autoStart" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" uimode="full" width="240" height="320"
src="" autostart="true" loop="true">
</object><br>
</span>
<input type="button" name="BtnPlay" value="PLAY" onclick="StartMeUp()">
<input type="button" name="BtnStop" value="STOP" onclick="ShutMeDown()">
<input type="button" name="Btnfull" value="FULL" onclick="screenfull()">
</body>
</html>
brentk711
09-09-2005, 10:31 PM
:thumbsup: Fantastic! Thanks so much! I never would have figured that out. My problem is I tend to take on more than I am capable of, but that's how I learn more. You have been more than patient with my Noobiness. :D
Thanks again.
Brent
Hello
I'm SS. I have been trying for weeks to get these songs i have to play with a pop-up media player when the buttons i made are clicked and nothing works. Can someone please show me what the code is supposed to look like with these codes i have?
These are the buttons i made
src="http://tekcities.com/ss_karaoke/button270819.jpg"></A></P>
<P align=left> </P>
<P align=left>
<P align=left></P>
<P align=left> <IMG src="http://tekcities.com/ss_karaoke/button642326.jpg"></P>
<P align=left> </P>
<P align=left> <IMG src="http://tekcities.com/ss_karaoke/button447073.jpg"></P>
<P align=left> </P>
<P align=left> <IMG src="http://tekcities.com/ss_karaoke/button213280.jpg"></P>
This is the code i have for the media player
<!-- begin embedded WindowsMedia file... -->
<table border='0' cellpadding='0' align="center">
<tr><td>
<OBJECT id='mediaPlayer' width="320" height="285"
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://servername/path/to/media.file">
<param name='animationatStart' value='true'>
<param name='transparentatStart' value='true'>
<param name='autoStart' value="false">
<param name='showControls' value="true">
<param name='loop' value="true">
<EMBED type='application/x-mplayer2'
pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1'
bgcolor='darkblue' showcontrols="true" showtracker='-1'
showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="320" height="285"
src="http://servername/path/to/media.file" autostart="false" designtimesp='5311' loop="true">
</EMBED>
</OBJECT>
</td></tr>
<!-- ...end embedded WindowsMedia file -->
<!-- begin link to launch external media player... -->
<tr><td align='center'>
<a href="http://servername/path/to/media.file" style='font-size: 85%;' target='_blank'>Launch in external player</a>
<!-- ...end link to launch external media player... -->
</td></tr>
</table>
Will these files played if i uploaded them from my computer to my site or do they have to come from another online storage?
These are the music files i have uploaded
Song1.mp3
song2.mps
song3.mp3
song4.mp3
:) I thought the colors would make it easier to read
Thank you sooooo much in advance, i hope you can make sense of this
SS
_Aerospace_Eng_
09-10-2005, 08:21 AM
<!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">
a img {
border:0;
}
</style>
<script type="text/javascript">
function openWin(url){
player=window.open(url,'player','width=300,height=100,left=0,top=0');
}
function PlayIt(what){
player.document.getElementById('music').innerHTML='<object width="300" height="45" '
+'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
+'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="url" value="'+what+'">'
+'<param name="uiMode" value="full">'
+'<param name="autoStart" value="true">'
+'<param name="loop" value="true">'
+'<embed type="application/x-mplayer2" '
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="300" height="45" '
+'src="'+what+'" autostart="true" loop="true">'
+'</object>';
}
</script>
</head>
<body>
<a href="player.html" onclick="openWin(this.href);return false;">Open Music Player</a>
<a href="song1.mp3" onclick="PlayIt(this.href);return false"><img src="http://www.tekcities.com/ss_karaoke/button642326.jpg" alt=""></a>
<a href="song2.mp3" onclick="PlayIt(this.href);return false"><img src="http://www.tekcities.com/ss_karaoke/button447073.jpg" alt=""></a>
<a href="song3.mp3" onclick="PlayIt(this.href);return false"><img src="http://www.tekcities.com/ss_karaoke/button213280.jpg" alt=""></a>
</body>
</html>
Thanks so much Aero,
How can i move the buttons to where i want them?........they show up on page going across, is there a special code for this?
You are awsome with your helpfulness and your promptness :thumbsup:
i havent been able to play around with it as the site im with is currently in a switch process but they should be up and running tomorrow.
_Aerospace_Eng_
09-11-2005, 12:46 AM
Its just a matter of using html. Check out www.w3schools.com and www.htmldog.com
Thank you so much I really appericate it.
Wolfmans55
09-12-2005, 11:30 PM
How could I get an embedded windows media player that plays the file when you get to the page with the player. Meaning when I go to the homepage a video is playing well maybe loading but will eventually play. Could I do that? Thanks
_Aerospace_Eng_
09-13-2005, 12:03 AM
http://cit.ucsf.edu/embedmedia/step1.php
Good Luck.
brentk711
09-14-2005, 04:58 PM
Was wondering if there's a way to show the picture artwork in a WMA file in an embedded media player? I have the capabilty to add or change the picture. Anyone?
current code:
<span id="music">
<object id="player" name="player" width="320" height="304"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
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="url" value="">
<param name="uiMode" value="full">
<param name="autoStart" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" uimode="full" width="320" height="304"
src="" autostart="true" loop="true">
</object><br>
</span>
_Aerospace_Eng_
09-14-2005, 05:59 PM
Okay look you are trying to do wayyyyy too much with WMP. It can only do so much. Flash or some other form of media would be better. What you want can be done but using a select menu it would be a bit hard to do. If you were using links you could do it quite easily.
brentk711
09-14-2005, 06:11 PM
Thanks. I knew that was a bit too far, but hey doesnt hurt to ask. I have everything working very good so far and just wanted to liven things up when playing an audio file. Actually I am now using an applet menu to select wms & wmv files. It has some more abilities and options as far as actions on links. Now I'm using a script link to :
<!--
function StartMeUpX(){
player.url = "mysong.wma";
}
You had mentioned in a previous post to someone about displaying visualizations by <param name="uiMode" value="full">, but that didnt do anything in mine.
Just curious how would I do the artwork with a link as you mentioned? If it's too much work to answer thats cool.
Thanks for awesome coding!
BT
_Aerospace_Eng_
09-14-2005, 06:27 PM
The visualization will only work in Internet Explorer, and it will only work if you aren't playing a video and it should work on wmas not sure.
<!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>
<script type="text/javascript">
<!--
function StartMeUp(){
player.url = "tc4014-v.wmv";
}
function screenfull(){
/* Check to be sure the player is playing. */
if (player.playState == 3)
player.fullScreen = 'true';
}
function ShutMeDown(){
player.controls.stop();
}
function PlayIt(what,img){
document.player.url=what;
document.getElementById('pix').innerHTML='<img src="'+img+'" width="100" height="100" alt="">';
}
//-->
</script>
</head>
<body>
<a href="s292.wma" onclick="PlayIt(this.href,'image1.jpg');return false">Jon Courson - Song</a><br>
<a href="somevideo.wmv" onclick="PlayIt(this.href,'image2.jpg');return false">Jon Courson - Video</a><br>
<span id="music">
<object id="player" name="player" width="240" height="320"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
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="url" value="">
<param name="uiMode" value="full">
<param name="autoStart" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" uimode="full" width="240" height="320"
src="" autostart="true" loop="true">
</object><br>
</span>
<span id="pix"></span>
<input type="button" name="BtnPlay" value="PLAY" onclick="StartMeUp()">
<input type="button" name="BtnStop" value="STOP" onclick="ShutMeDown()">
<input type="button" name="Btnfull" value="FULL" onclick="screenfull()">
</body>
</html>
brentk711
09-14-2005, 07:26 PM
Iteresting. Didnt quite work though. I created 2 test images (image1.jpg & image2.jpg). When you click the link for the wma it displays image1.jpg below the media player just left of bottom buttons (PLAY, STOP, FULL). Same for video file link (displays image2.jpg). and the wma & wmv dont play.
Seems to be trying because the player PLAY button lights up and in the black part of the WMP area it displays "Ready". Clicking the PLAY button on the WMP doesnt do anything at that point either.
_Aerospace_Eng_
09-15-2005, 04:15 AM
Did you change the href? I didn't use one of your hrefs or your songs. I used a song I had and it works. Make sure the location of your files is correct. Give us a link and we'll look at it. If you say I can't, I haven't bought hosting well then get a free web host temporarily.
brentk711
09-15-2005, 06:07 AM
This is exactly what I have:
<!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>
<script type="text/javascript">
<!--
function StartMeUp(){
player.url = "tc4014-v.wmv";
}
function screenfull(){
/* Check to be sure the player is playing. */
if (player.playState == 3)
player.fullScreen = 'true';
}
function ShutMeDown(){
player.controls.stop();
}
function PlayIt(what,img){
document.player.url=what;
document.getElementById('pix').innerHTML='<img src="'+img+'" width="100" height="100" alt="">';
}
//-->
</script>
</head>
<body>
<a href="s292.wma" onclick="PlayIt(this.href,'image1.jpg');return false">Jon Courson - Song</a><br>
<a href="tc4014-v.wmv" onclick="PlayIt(this.href,'image2.jpg');return false">Jon Courson - Video</a><br>
<span id="music">
<object id="player" name="player" width="240" height="320"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
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="url" value="">
<param name="uiMode" value="full">
<param name="autoStart" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" uimode="full" width="240" height="320"
src="" autostart="true" loop="true">
</object><br>
</span>
<span id="pix"></span>
<input type="button" name="BtnPlay" value="PLAY" onclick="StartMeUp()">
<input type="button" name="BtnStop" value="STOP" onclick="ShutMeDown()">
<input type="button" name="Btnfull" value="FULL" onclick="screenfull()">
</body>
</html>
All files are in one folder (image1.jpg,image2.jpg,s292.wma,tc4014-v.wmv)
do the jpg files display within th emedia player?
What am I missing here? No I dont have web hosting anymore. It doesnt need to be uploaded to the web to work does it?
Free webhosting? Were do you get that? I can search google but thought you would have a recommendation.
thanks! BT
_Aerospace_Eng_
09-15-2005, 06:16 AM
Its not meant to "attach" to the player if that is what you are wanting. It shouldn't matter what image you use, they should all work. Maybe try this
<!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>
<script type="text/javascript">
<!--
function StartMeUp(){
player.url = "tc4014-v.wmv";
}
function screenfull(){
/* Check to be sure the player is playing. */
if (player.playState == 3)
player.fullScreen = 'true';
}
function ShutMeDown(){
player.controls.stop();
}
function PlayIt(what,img){
document.player.url=what;
document.getElementById('pix').innerHTML='<img src="'+img+'" width="100" height="100" alt="">';
}
//-->
</script>
</head>
<body>
<a href="s292.wma" onclick="PlayIt(this.href,'image1.jpg');return false">Jon Courson - Song</a><br>
<a href="tc4014-v.wmv" onclick="PlayIt(this.href,'image2.jpg');return false">Jon Courson - Video</a><br>
<span id="music">
<object id="player" name="player" width="240" height="320"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
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="url" value="">
<param name="uiMode" value="full">
<param name="autoStart" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" uimode="full" width="240" height="320"
src="" autostart="true" loop="true">
</object>
</span>
<span id="pix"></span><br>
<input type="button" name="BtnPlay" value="PLAY" onclick="StartMeUp()">
<input type="button" name="BtnStop" value="STOP" onclick="ShutMeDown()">
<input type="button" name="Btnfull" value="FULL" onclick="screenfull()">
</body>
</html>
brentk711
09-15-2005, 03:51 PM
HI
Yes, that was my original question... to put the image from the picture tag of the WMA file into the black area of the WMP. I can use the script you provided to do the same similar thing. thanls, thats cool. Only problem is the links dont play the files. URL is correct and files are in the same directory.
_Aerospace_Eng_
09-15-2005, 07:02 PM
Seems it only plays mp3s when trying to pass a parameter to the function. Looks like you are out of luck here. Personally I think you are trying to do way too much with WMP. Just start learning flash, it can do the things you want. Good Luck.
brentk711
09-15-2005, 07:30 PM
Thanks. Yes, I need to start learning flash. Do you have any recommendations on tools to start with? Any programs or websites that would help getting started? You have helped immensly. I can now finish my webpages with what I have. I'm busy writing a GWBASIC :eek: utility to crunch some text files into html code for links to my media files. It also will create the menu text files for my applet menu. It's archaic but it saves me a lot of time. PLus its the only programming language I ever learned. :)
Thanks again for your super nice help!
_Aerospace_Eng_
09-15-2005, 07:38 PM
Well flash 8 is a great tool but its not free. www.flashkit.com has many good tutorials and some already created fla files that you might be able to use. I like this site, it is awesome for flash video tutorials http://www.gotoandlearn.com/index2.html
Hello,
I tried the code you gave me but it still wouldn't work. Maybe I'm Puting it in the wrong place, I don't know. So I thought I'd try this one
Here is my page's view source......WWW.tekcities.com/ss_karaoke/index.html.........................
<HTML><HEAD><TITLE>Listen To A Demo</TITLE>
<META content="MSHTML 6.00.2900.2722" name=GENERATOR></HEAD>
<BODY text=#000000 link=#ffd700 bgColor=#000000 background=17musBar.gif backgroundAttachment="fixed" marginLeft="0" marginTop="0">
<P></P>
<P></P>
<H1 align=center><FONT color=#ffa500 size=7>Welcome To</FONT></H1>
<P align=center><FONT face=Arial color=#ffa500 size=7>Karaoke On The Road</FONT></P>
<P align=center><FONT face="Lucida Console" color=#ffa500 size=2><FONT size=5>KJ</FONT>: <FONT size=4>Robbie Southgate</FONT></FONT></P>
<P align=center><FONT face=Arial color=#ffa500 size=7></FONT> </P>
<P align=center><IMG src="http://tekcities.com/ss_karaoke/1005177899.jpg"></P>
<P align=left> </P>
<P align=left> </P>
<P align=left> <A href="http://www.tekcities.com/ss_karaoke/index.html"><IMG src="http://tekcities.com/ss_karaoke/button823090.jpg"></A></P>
<P align=left>
</img></img></img></img> <IMG src="http://www.tekcities.com/ss_karaoke/button270819.jpg"></P>
<P align=left> <IMG src="http://tekcities.com/ss_karaoke/button642326.jpg"></P>
<P align=left> <IMG src="http://tekcities.com/ss_karaoke/button447073.jpg"></P>
<P align=left> <IMG src="http://tekcities.com/ss_karaoke/button213280.jpg"></P>
<P align=left> </P>
<P align=left> </P>
<P align=left> </P>
<P align=left> </P>
<P align=left> </P>
<P align=left> </P>
<P align=left> </P>
<P align=left> </P>
<!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>
<div id="jukebox">JUKEBOX<br><br>
<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>
<option value="http://urltosong6.mp3">Song 6</option>
<option value="http://urltosong7.mp3">Song 7</option>
<option value="http://urltosong8.mp3">Song 8</option>
<option value="http://urltosong9.mp3">Song 9</option>
<option value="http://urltosong10.mp3">Song 10</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>..................................
Can you please show me how this code intergrats with the buttons I already have on my page so they can be clicked and the song will play?
I would so much appericate it, I have been trying to get this done for about 2 months now :(
_Aerospace_Eng_
09-16-2005, 05:22 AM
I think you should learn the basics of html. You might be taking on more than you can handle at the moment. The code you posted looks NOTHING like the code I gave you.
<!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>Listen To A Demo</TITLE>
<script type="text/javascript">
<!--
function PlayIt(what){
document.getElementById('music').innerHTML='<object width="300" height="44" '
+'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
+'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="url" value="'+what+'">'
+'<param name="uiMode" value="full">'
+'<param name="autoStart" value="true">'
+'<param name="loop" value="true">'
+'<embed type="application/x-mplayer2" '
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="300" height="45" '
+'src="'+what+'" autostart="true" loop="true">'
+'<\/object>';
}
//-->
</script>
<style type="text/css">
body {
color:#000000;
background:url(17musBar.gif) fixed;
margin:0;
padding:0;
text-align:center;
}
a, a:link {
color:#FFD700;
}
a img {
border:0;
}
.orange {
color:#FFA500;
}
.centered {
text-align:center;
}
</style>
</head>
<body>
<p></p>
<p></p>
<h1 class="orange centered">Welcome To<br>Karaoke On The Road</h1>
<h2 class="orange centered">KJ:Robbie Southgate</h2>
<p class="centered"><img alt="" src="http://tekcities.com/ss_karaoke/1005177899.jpg"></p>
<p> </p>
<p> </p>
<p> <a href="http://www.tekcities.com/ss_karaoke/index.html"><img alt="" src="http://tekcities.com/ss_karaoke/button823090.jpg"></a></p>
<p> <a href="song1.mp3" onclick="PlayIt(this.href);return false"><img alt="" src="http://www.tekcities.com/ss_karaoke/button270819.jpg"></a></p>
<p> <a href="song2.mp3" onclick="PlayIt(this.href);return false"><img alt="" src="http://tekcities.com/ss_karaoke/button642326.jpg"></a></p>
<p> <a href="song3.mp3" onclick="PlayIt(this.href);return false"><img alt="" src="http://tekcities.com/ss_karaoke/button447073.jpg"></a></p>
<p> <a href="song4.mp3" onclick="PlayIt(this.href);return false"><img alt="" src="http://tekcities.com/ss_karaoke/button213280.jpg"></a></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<span id="music">
<object width="300" height="44"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
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="url" value="">
<param name="uiMode" value="full">
<param name="autoStart" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" uimode="full" width="300" height="44"
src="what" autostart="true" loop="true"></embed>
</object>
</span>
</body>
</html>
To learn more about html go to www.w3schools.com and www.htmldog.com
silverferro
09-17-2005, 12:19 PM
Hi guys have been trying to create a embedded WMP on my website to :
1)Play an intro movie automatically once the page is loaded
2)Allow the visiter to choose a particular movie by clicking a text link or image to load inside the embedded WMP.
The 1st goal is achevied and the movie loads perfectly. But when i click the text links to choose another movie, it opens my WMP on my computer rather then load in the embedded WMP.I scavenged the net but only can find examples on the old classid and not the latest one(6BF52A52-394A-11d3-B153-00C04F79FAA6). When I change the classid on a working code to this new one it stops working.Can someone help me pls. :confused:
This is a sample code I came out by cutting and pasting from various parts off the net. I know it goes something like this but lacks something to work properly. 1st 3 links are text links and the 4th one is an image link. Can someone tell me what it is missing and how to make it work?
<OBJECT id=Player classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 width="400" height="300">
<PARAM NAME="URL" VALUE="http://www.host.com/files/intro.wmv">
<PARAM NAME="uiMode" value="none">
<PARAM NAME="autoStart" VALUE="true">
<PARAM NAME="stretchtofit" value="true">
<PARAM NAME="enabled" value="true">
<PARAM NAME="windowlessVideo" VALUE="false">
</OBJECT>
<a href="http://www.host.com/files/video1.wmv" onclick="Player.PlayIt(this.href);return false">Video 1</a>
<a href="http://www.host.com/files/video2.wmv" onclick="Player.PlayIt(this.href);return false">Video 2</a>
<a href="http://www.host.com/files/video3.wmv" onclick="Player.PlayIt(this.href);return false">Video 3</a>
<a href="http://www.host.com/files/video4.wmv" onclick="Player.PlayIt(this.href);return false"><img alt="" src="http://www.host.com/images/button.jpg"></a>
Can some one tell me what these lines mean? These lines were not given in the sample codes in the microsoft SDK and I tried without them and it still works.Atleast for the 1st part that is.Are they used for the older classid and not needed for the new one any more? Thanks alot in advance.
'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">'
_Aerospace_Eng_
09-17-2005, 05:12 PM
Are you only trying to cater for Internet Explorer? And have you actually read this whole thread? Carefully? The answer you are looking for has been provided, quite recently actually, the brentk threads talk a lot about what you are trying to do.
silverferro
09-18-2005, 12:57 PM
yeah i did go through the whole thing for 2 days.the thing is i'm new to WMP codes.I actully started out with Flash videos but the clips were not playing smoothly so i tried wmv and the encoded file was smaller and the quality is MUCH better wile streaming. Thats y i want to use WMP. But when ever I try to change anything in the posted codes to my requirements, it just won't work. So i just cut the portions which I can understand and try to work from there. The previous codes are based on either older classid or use buttons or drop down menus not image or text linka to start a new movie. Thats the part i'm trying to change but everyhting goes wrong. Well it will be nice if very browser can view it if not I shall just take IE as most people use that.
_Aerospace_Eng_
09-18-2005, 05:05 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.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>
<script type="text/javascript">
<!--
function PlayIt(what){
document.getElementById('music').innerHTML='<object width="300" height="44" '
+'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
+'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="url" value="'+what+'">'
+'<param name="uiMode" value="full">'
+'<param name="autoStart" value="true">'
+'<param name="loop" value="true">'
+'<embed type="application/x-mplayer2" '
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="300" height="45" '
+'src="'+what+'" autostart="true" loop="true">'
+'<\/object>';
}
//-->
</script>
</head>
<body>
<a href="http://www.host.com/files/video1.wmv" onclick="PlayIt(this.href);return false">Video 1</a><br>
<a href="http://www.host.com/files/video2.wmv" onclick="PlayIt(this.href);return false">Video 2</a><br>
<a href="http://www.host.com/files/video3.wmv" onclick="PlayIt(this.href);return false">Video 3</a><br>
<a href="http://www.host.com/files/video4.wmv" onclick="PlayIt(this.href);return false">Video 4</a><br><br>
<span id="music">
<object id="player" name="player" width="320" height="240"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
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="url" value="">
<param name="uiMode" value="full">
<param name="autoStart" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" uimode="full" width="320" height="240"
src="" autostart="true" loop="true">
</object>
</span>
</body>
</html>
silverferro
09-19-2005, 04:24 AM
I think now I know what I have been doing wrong. :eek: All this while I have been throwing this part in quote away and only taking the next part. I was thinking why are there two codes with same params repeated and always didn't put this part. But this time i just copied everything and it worked. Sorry for the stupid mistake and wasting your time.It works great in IE but only shows the contorl and not the movie in FireFox.Its ok i think i can tweak it from your previous codes.Thanks alot. :thumbsup:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.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>
<script type="text/javascript">
<!--
function PlayIt(what){
document.getElementById('music').innerHTML='<object width="300" height="44" '
+'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
+'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="url" value="'+what+'">'
+'<param name="uiMode" value="full">'
+'<param name="autoStart" value="true">'
+'<param name="loop" value="true">'
+'<embed type="application/x-mplayer2" '
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="300" height="45" '
+'src="'+what+'" autostart="true" loop="true">'
+'<\/object>';
}
//-->
</script>
</head>
<body>
<a href="http://www.host.com/files/video1.wmv" onclick="PlayIt(this.href);return false">Video 1</a><br>
<a href="http://www.host.com/files/video2.wmv" onclick="PlayIt(this.href);return false">Video 2</a><br>
<a href="http://www.host.com/files/video3.wmv" onclick="PlayIt(this.href);return false">Video 3</a><br>
<a href="http://www.host.com/files/video4.wmv" onclick="PlayIt(this.href);return false">Video 4</a><br><br>
<span id="music">
<object id="player" name="player" width="320" height="240"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
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="url" value="">
<param name="uiMode" value="full">
<param name="autoStart" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" uimode="full" width="320" height="240"
src="" autostart="true" loop="true">
</object>
</span>
</body>
</html>
_Aerospace_Eng_
09-19-2005, 06:12 AM
change this
<script type="text/javascript">
<!--
function PlayIt(what){
document.getElementById('music').innerHTML='<object width="300" height="44" '
+'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
+'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="url" value="'+what+'">'
+'<param name="uiMode" value="full">'
+'<param name="autoStart" value="true">'
+'<param name="loop" value="true">'
+'<embed type="application/x-mplayer2" '
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="300" height="45" '
+'src="'+what+'" autostart="true" loop="true">'
+'<\/object>';
}
//-->
</script>
to this
<script type="text/javascript">
<!--
function PlayIt(what){
document.getElementById('music').innerHTML='<object width="320" height="240" '
+'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
+'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="url" value="'+what+'">'
+'<param name="uiMode" value="full">'
+'<param name="autoStart" value="true">'
+'<param name="loop" value="true">'
+'<embed type="application/x-mplayer2" '
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="320" height="240" '
+'src="'+what+'" autostart="true" loop="true">'
+'<\/object>';
}
//-->
</script>
mrodger
09-19-2005, 07:02 PM
I'm using the following code to embed a windows media player on my page:
<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" player.currentMedia.name>
<param name="fileName" value="http://yourday.clemson.edu/gattisproject/audio/gattisplayer1.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://yourday.clemson.edu/gattisproject/audio/gattisplayer1.m3u" autostart="true" designtimesp="5311" loop="true">
</object>
It's working great, but I'd like to display the title of the track that is currently playing. This was covered before in this post (http://www.codingforums.com/showpost.php?p=270900&postcount=11) but that applied to an earlier version of the code. Can anyone give me any suggestions as to how to get the title of the currently playing track to display? Thanks.
_Aerospace_Eng_
09-19-2005, 07:35 PM
This can't be done in javascript alone. Javascript can read a file but it needs activex to write text from the file. What you are probably going to need to do is put the player in an iframe and use php to read the lines of the file using a php array. Onchange submit to the php file and write out the code with the appropiate title. I don't have the time currently to show you how to do this but I've told you what you need to do and hopefully pointed you in the right direction.
silverferro
09-20-2005, 09:59 AM
Thanks for the help _Aerospace_Eng_......thanks alot.
mrodger.....I think the code below can be used to do what you want. I took it from MSDN while trying to fix my codes which Aerospace_Eng helped me fix.
basicly u add this script on the same page as your embedded WMP and then create a DIV ELEMENT. And under ID, name the DIV ELEMENT "MediaName" without the "". Maybe you can try this.See if it works.
Example Code
The following JScript example uses an HTML DIV element, named MediaName,
to display the name of the current media item. The code updates the text
in the DIV with each occurrence of the mediaChange event.
The Player object was created with ID = "Player".
<!-- Create an event handler for media change. -->
<SCRIPT FOR = "Player" EVENT = "mediaChange(Item)">
// Test whether a valid currentMedia object exists.
if (Player.currentMedia){
// Display the name of the current media item.
MediaName.innerHTML = Player.currentMedia.name;
}
</SCRIPT>
-------------------------------------------------------------------------
brentk711
09-21-2005, 06:33 PM
Hi Aerospace,
I have my web pages finished thanks to your help!! :)
I have one last desire...
The code you posted in #201 here doesnt play a mp3 file. Is there something else I need to know?
your code : (I just put an MP3 file in the same folder and changed the link to that mp3 (aimee.mp3)
Thanks!
<!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>
<script type="text/javascript">
<!--
function StartMeUp(){
player.url = "tc4014-v.wmv";
}
function screenfull(){
/* Check to be sure the player is playing. */
if (player.playState == 3)
player.fullScreen = 'true';
}
function ShutMeDown(){
player.controls.stop();
}
function PlayIt(what,img){
document.player.url=what;
document.getElementById('pix').innerHTML='<img src="'+img+'" width="100" height="100" alt="">';
}
//-->
</script>
</head>
<body>
<a href="aimee.mp3" onclick="PlayIt(this.href,'image1.jpg');return false">Jon Courson - Song</a><br>
<a href="aimee.mp3" onclick="PlayIt(this.href,'image2.jpg');return false">Jon Courson - Video</a><br>
<span id="music">
<object id="player" name="player" width="240" height="320"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
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="url" value="">
<param name="uiMode" value="full">
<param name="autoStart" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" uimode="full" width="240" height="320"
src="" autostart="true" loop="true">
</object><br>
</span>
<span id="pix"></span>
<input type="button" name="BtnPlay" value="PLAY" onclick="StartMeUp()">
<input type="button" name="BtnStop" value="STOP" onclick="ShutMeDown()">
<input type="button" name="Btnfull" value="FULL" onclick="screenfull()">
</body>
</html>
_Aerospace_Eng_
09-25-2005, 07:45 PM
Read post 207. It doesn't like when you mix them.
brentk711
09-26-2005, 04:52 PM
Sorry, I put the wrong code in last time in previous post. I really didnt mix them. See below. They are all MP3's. The PLAY button on bottom works, but the links dont play. When you click a link it will change the image and display READY in the WMP window. Also if you had played the song by clicking the PLAY button (<input type="button" name="BtnPlay" value="PLAY" onclick="StartMeUp()">) it stops the playing. Any ideas?
Here's the 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>
<script type="text/javascript">
<!--
function StartMeUp(){
player.url = "aimee.mp3";
}
function screenfull(){
/* Check to be sure the player is playing. */
if (player.playState == 3)
player.fullScreen = 'true';
}
function ShutMeDown(){
player.controls.stop();
}
function PlayIt(what,img){
document.player.url=what;
document.getElementById('pix').innerHTML='<img src="'+img+'" width="100" height="100" alt="">';
}
//-->
</script>
</head>
<body>
<a href="AIMEE.MP3" onclick="PlayIt(this.href,'image1.jpg');return false">Aimee mann mp3</a><br>
<a href="aimee.mp3" onclick="PlayIt(this.href,'image2.jpg');return false">Aimee mann mp3</a><br>
<span id="music">
<object id="player" name="player" width="240" height="320"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
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="url" value="">
<param name="uiMode" value="full">
<param name="autoStart" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" uimode="full" width="240" height="320"
src="" autostart="true" loop="true">
</object><br>
</span>
<span id="pix"></span>
<input type="button" name="BtnPlay" value="PLAY" onclick="StartMeUp()">
<input type="button" name="BtnStop" value="STOP" onclick="ShutMeDown()">
<input type="button" name="Btnfull" value="FULL" onclick="screenfull()">
</body>
</html>
higlhand
09-29-2005, 02:19 AM
Hi Mr. Aerospace... First let me say you are a walking HTML dictionary. :)
Here's my problem:
I created a Voice Blog on the Blogger site with the help of a friend of mine.
Before I finally got it all done and correct I was searching the Net for help and came upon this particular thread.... My friend called me back during the time was looking for help and we finally resolved the issue.
But, as I was looking for help on here... I saw a cool explaination you gave to someone about how to code a "drop down" window for vistors to choose songs from. I thought that was amazing.
The example you gave was for a class id for Windows Media Player 6 ( 22D6F312-B0F6-11D0-94AB-0080C74C7E95) ...which I did not know about at the time ( I am a novice at this ).
Anyway... I used your HTML code for the drop down window as folllows:
<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>
.
.
.
.
....I changed the class id the my Windows Media Player10 class id ( 6BF52A52-394A-11d3-B153-00C04F79FAA6"> ) and the result was this:
1- When I selected the song I wanted to hear, nothing played. So I changed it back to the Class Id you gave and it worked but my Visualization ( the cool little shapes and forms that move to the beat of the music) , did not appear in the black window on the player. Just a blank black window
I saw the other examples you gave using my class id and tried those and every combination of the codes.
I cant get both things to work at the same time.
The following is how I currently have it coded ( with the wrong Class Id ) and it is working, but without the Vizualizations. I'd really like to see the Visualizations in the player and i think it has to due with the Class Id thing.
NOTE: I currently dont have it coded like your examples, but as i said, its working with the wrong Class ID.
Here is how it currently coded:
<div align=center>
<SELECT id=cancion onchange=document.all.player.filename=document.all.cancion.value; size=1 name=Player>
<OPTION selected>::::::::::::: Choose Your Song Here :::::::::::::</OPTION>
<OPTION value=http://70.68.1.185:8000>Vibes to the Max</OPTION>
<OPTION value=http://213.251.136.193:8200>Soulful Smooth Jazz</OPTION>
<OPTION value=http://64.236.34.196:80/stream/1018>Goove Salad</OPTION>
<OPTION value=http://69.28.132.228:8400>CIM Smooth Fusion</OPTION>
</SELECT><BR>
<OBJECT id="player" height="183" width="216"classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95
<param name="rate" value="1">
<param name="balance" value="1">
<param name="filename" value="">
<param name="currentPosition" value="0">
<param name="defaultFrame" value="">
<param name="playCount" value="2">
<param name="autoStart" value="1">
<param name="currentMarker" value="0">
<param name="invokeURLs" value="-1">
<param name="volume" value="40">
<param name="mute" value="0">
<param name="uiMode" value="full">
<param name="stretchToFit" value="0">
<param name="windowlessVideo" value="0">
<param name="enabled" value="-1">
<param name="enableContextMenu" value="-1">
<PARAM NAME="AnimationAtStart" VALUE="1">
<param name="fullScreen" value="0">
<PARAM NAME="ShowStatusBar" VALUE="1">
<param name="SAMIStyle" value="">
<param name="SAMILang" value="">
<param name="SAMIFilename" value="">
<param name="captioningID" value="">
<param name="enableErrorDialogs" value="0">
<param name="_cx" value="8599">
<param name="_cy" value="7276">
</OBJECT>
</div>
Bottom line is this... Can you help me with making this work, using my correct class id and having the Visualizations too...
Thanks... I know this was a bit long winded.... but i wanted to make myself clear...
Thanks again !
higlhand
09-29-2005, 04:07 AM
By the way Aerospace... Here is my Blog site where you can see the visualization working with the simple code without the drop down window implemented and the code for it.... http://crazylegsdancin.blogspot.com/
<object id="Player" height="183" width="216" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<param name="URL" value="http://69.28.132.228:8400">
<param name="rate" value="1">
<param name="balance" value="1">
<param name="currentPosition" value="0">
<param name="defaultFrame" value="">
<param name="playCount" value="2">
<param name="autoStart" value="1">
<param name="currentMarker" value="0">
<param name="invokeURLs" value="-1">
<param name="baseURL" value="">
<param name="volume" value="40">
<param name="mute" value="0">
<param name="uiMode" value="full">
<param name="stretchToFit" value="0">
<param name="windowlessVideo" value="0">
<param name="enabled" value="-1">
<param name="enableContextMenu" value="-1">
<param name="fullScreen" value="0">
<param name="SAMIStyle" value="">
<param name="SAMILang" value="">
<param name="SAMIFilename" value="">
<param name="captioningID" value="">
<param name="enableErrorDialogs" value="0">
<param name="_cx" value="8599">
<param name="_cy" value="7276">
</object>
.. this works just as it should... but when i try to implement the "drop down window" it doesnt work....
Its gotta be something simple... I just dont get it... Thanks again
higlhand
09-29-2005, 02:04 PM
Read post 207. It doesn't like when you mix them.
Hope I posted my question in the correct format... I'm also new to this forum or any forum for that matter
_Aerospace_Eng_
09-30-2005, 06:08 PM
I suggest that you read this thread again carefully particularly the "brentk711" posts. You can't be mixing classids and param names. The param names for WMP6 ARE NOT the same for param names for WMP8+. There is a version already posted that works in more than Internet Explorer and has a drop down menu. If your blog doesn't allow javascript then the drop down is useless. It won't work at all.
higlhand
09-30-2005, 07:47 PM
Thanks for the reply Aerospace..
I assume the Blog does allow Javascript because the drop down menu is working. It is working even though my WMP is version 10 and class id I have coded is for WMP6. But because the class id is not for WMP10 the Visualizations do not appear in the black area of the player. (This is for music only I am trying to do this for.)
I have poured through all the various examples of code you posted and have tried each one to no avail.... I specifically looked at the Brent711 post and tried each of the examples you gave for him....
So if I understand you correctly... I cant Class ID this code for WMP10 "AND" have the Visualizations too.... That's unfortunate.... I really liked the drop down menu idea but I miss not seeing my swirling lights in the black box...
If it cant be done...oh well.... Thanks anyway... I appreciate your help.
P.S.. this is the Blog that has the drop down menu. There are 2 players on that page... The top one is coded for the drop down menu...the one under that just points to a single URL on the "Archive.org" site where I have a voice recording archived... In the bottom one you can see the lights as the recording plays... http://dancinforyou.blogspot.com/
_Aerospace_Eng_
09-30-2005, 08:44 PM
Here. The visualizations will only work in IE. They won't work in Firefox so don't even ask.
<!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>
<script type="text/javascript">
function PlayIt(what){
player.document.getElementById('music').innerHTML='<object width="300" height="300" '
+'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
+'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="url" value="'+what+'">'
+'<param name="uiMode" value="full">'
+'<param name="autoStart" value="true">'
+'<param name="loop" value="true">'
+'<embed type="application/x-mplayer2" '
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="300" height="45" '
+'src="'+what+'" autostart="true" loop="true">'
+'</object>';
}
</script>
</head>
<body>
<select name="player" onchange="PlayIt(this.value)">
<option value="none">::Choose a Song::</option>
<option value="http://home.austin.rr.com/fairpoolerz/switchfoot.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>
<div id="music">
<object width="300" height="300"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
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="url" value="">
<param name="uiMode" value="full">
<param name="autoStart" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" uimode="full" width="300" height="45"
src="" autostart="true" loop="true">
</object>
</div>
</html>
masterc246
10-01-2005, 12:46 AM
Hello All,
I found this simple yet very useful Windows Media Embedding code. I've used it for many of my listings for my real estate business.
<EMBED SRC="http://YOUR Site Link Here.wmv" AUTOSTART=FALSE>
here's a sample;
<EMBED SRC="http://boss.streamos.com/wmedia/remaxsat/promos/winshi.asx AUTOSTART=FALSE>
Hopefully this helps someone. Let me know if it does work for you.
dennisrealtor@yahoo.com
_Aerospace_Eng_
10-01-2005, 01:53 AM
Without declaring the plugins for Firefox it will prompt you to download the proper plugin. Quicktime will be the plugin that Firefox tries to download.
higlhand
10-04-2005, 11:55 PM
Aerospace...Thanks so much for your help.. What you gave me really did the trick.... I appreciate all you help and patience.... My appologies for PM....
{PAR} Sector A
10-05-2005, 05:32 AM
Hello, Aerospace
I've been following this topic for a while now and I was wondering if it was possible to have this work across frames so for example if the links were in one frame and the player was in another above it obviously being of two different pages.
_Aerospace_Eng_
10-05-2005, 06:26 AM
Hello, Aerospace
I've been following this topic for a while now and I was wondering if it was possible to have this work across frames so for example if the links were in one frame and the player was in another above it obviously being of two different pages.
Refer to the "TinmanIII" posts. The script is really similar the only difference is your using frames he used an iframe.
midasone
10-05-2005, 07:57 PM
I don't know whether this is relevant, but can someone please advise me on how to decrease the width of the drop-down menu.
Coding is as follows, so far:
<br>
<div align=right>
<SELECT id=cancion onchange=document.all.music.filename=document.all.cancion.value; size=1 name=Music>
<OPTION selected>---Songs While You Browse---<OPTION>
<OPTION value=> -List of tracks- </OPTION>
<option value=></option>
<option value=song1</option>
<option value=song2</option>
<option value=song3</option>
</SELECT><BR>
<table border=1]<tr><td><object id=music height=43 width=180 classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95>
<PARAM NAME="AutoStart" VALUE="-1">
<PARAM NAME="Balance" VALUE="0">
<PARAM NAME="DisplaySize" VALUE="1">
<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="100">
<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></td></tr></table>
</div>
_Aerospace_Eng_
10-05-2005, 09:01 PM
It would help to actually code correctly. Invalid coding is the root of where your problem starts.
This
<br>
<div align=right>
<SELECT id=cancion onchange=document.all.music.filename=document.all.cancion.value; size=1 name=Music>
<OPTION selected>---Songs While You Browse---<OPTION>
<OPTION value=> -List of tracks- </OPTION>
<option value=></option>
<option value=song1</option>
<option value=song2</option>
<option value=song3</option>
</SELECT><BR>
<table border=1]<tr><td>
Should look something along the lines of this
<br>
<div align="right">
<select id="cancion" onchange="document.all.music.filename=document.all.cancion.value;" size="1" name="Music">
<option value="" selected>---Songs While You Browse---<OPTION>
<option value=""> -List of tracks- </option>
<option value=""></option>
<option value="song1"</option>
<option value="song2"></option>
<option value="song3"></option>
</select><br>
<table border="1"><tr><td>
The select menu will be as long as the longest option in it. Note: the code you are using for the player will only work in Internet Explorer. If you want it to work in other browsers then I suggest you actually look for the code that works in the other browsers to. I don't have time to point it out to you. There is a search feature for a reason.
midasone
10-05-2005, 09:13 PM
Okay, thanks for your help. :)
Aside from the fact that I started this about two days ago; I have absolutely no experience in coding whatsoever.
Any other hints you could offer me?
_Aerospace_Eng_
10-06-2005, 12:53 AM
Get the basics down first until you start trying to do media. http://www.w3schools.com and www.htmldog.com are good places to learn html. Don't try to take on more than you can handle.
yutsuko1983
10-09-2005, 04:50 AM
I got the code from one of the post..but I want to make editing. How to activate the next song button?
_Aerospace_Eng_
10-09-2005, 06:26 PM
Which code are you using?
jamminjay
10-15-2005, 03:33 PM
got problems trying create a playlist with a code below.. the code below shows just one clip running, but i would like to know how i can make 5 play instead than 1.
<div style='font-size: 11pt;'><center>
<embed name='RAOCXplayer' src='http://website.com/video/file_8000.asx' autostart='true' type='application/x-mplayer2' width='300' height='250' showcontrols='1' showstatusbar='0' loop='True' enablecontextmenu='0' displaysize='0' pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/'></embed>
<br>
<br>
</div>
_Aerospace_Eng_
10-15-2005, 04:47 PM
Read post #4 here http://www.codingforums.com/showthread.php?t=61732
The playlist uses mp3s but it can use asx files as well.
alphabeta
10-18-2005, 05:27 AM
Hi _Aerospace_Eng_ ,
I'm wondering is there a way to show the status bar of the wmp embeded on the top of the player instead of the bottom...
I modified you're original code a bit but I could not display the status bar on top of the player here's the 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">
<!--
numm3u = 2
day = new Date()
z = day.getTime()
y = (z - (parseInt(z/1000,10) * 1000))/10
x = parseInt(y/100*numm3u,10) + 1
if (x == (1))
m3u=("xxx")
if (x == (2))
m3u=("xxx")
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='60' 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="xxx">Album 1</option>
<option value="xxx">Album 2</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="'+m3u+'" '
+'name="MediaPlayer1" '
+'showstatusbar="1" '
+'width="300" '
+'height="60" '
+'autostart="true">'
+'</embed>');
//-->
</script>
</span>
</div>
</body>
</html>
I was hoping to get the status bar on top like a regular embed
<p align="left">
<OBJECT id=Player height=60 width=271 classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 align="center">
<PARAM NAME="URL" VALUE="xxx">
<PARAM NAME="balance" VALUE="0">
<PARAM NAME="currentPosition" VALUE="0">
<PARAM NAME="playCount" VALUE="10">
<PARAM NAME="autoStart" VALUE="1">
<PARAM NAME="currentMarker" VALUE="0">
<PARAM NAME="invokeURLs" VALUE="-1">
<PARAM NAME="baseURL" VALUE="">
<PARAM NAME="volume" VALUE="50">
<PARAM NAME="mute" VALUE="0">
<PARAM NAME="uiMode" VALUE="full">
<PARAM NAME="stretchToFit" VALUE="0">
<PARAM NAME="windowlessVideo" VALUE="0">
<PARAM NAME="enableContextMenu" VALUE="-1">
<PARAM NAME="fullScreen" VALUE="0">
<PARAM NAME="SAMIStyle" VALUE="">
<PARAM NAME="_cx" VALUE="7170">
<PARAM NAME="_cy" VALUE="6641">
<embed type="application/x-mplayer2" src="xxx" autostart="1" name="MediaPlayer" height="60" width="271" loop="true">
</embed></OBJECT>
Thank you :D :thumbsup:
_Aerospace_Eng_
10-18-2005, 06:00 AM
People, people, the WMP embedded player isn't as customizable as you think it is. It is very limited to what you can do. Look around in this thread for the code that has the object tag in it.
<!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">
<!--
numm3u = 2
day = new Date()
z = day.getTime()
y = (z - (parseInt(z/1000,10) * 1000))/10
x = parseInt(y/100*numm3u,10) + 1
if (x == (1))
m3u=("xxx")
if (x == (2))
m3u=("xxx")
function song(){
document.getElementById('music1').innerHTML='<object width="271" height="60" '
+'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
+'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="url" value="'+m3u+'">'
+'<param name="uiMode" value="full">'
+'<param name="autoStart" value="true">'
+'<param name="loop" value="true">'
+'<embed type="application/x-mplayer2" '
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="271" height="45" '
+'src="'+m3u+'" autostart="true" loop="true">'
+'<\/object>';
}
//-->
</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="xxx">Album 1</option>
<option value="xxx">Album 2</option>
</select><br><br>
<span id="music1">
<script type="text/javascript">
<!--
document.write('<object width="271" height="60" '
+'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
+'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="url" value="'+m3u+'">'
+'<param name="uiMode" value="full">'
+'<param name="autoStart" value="true">'
+'<param name="loop" value="true">'
+'<embed type="application/x-mplayer2" '
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="271" height="45" '
+'src="'+m3u+'" autostart="true" loop="true">'
+'<\/object>');
//-->
</script>
</span>
</div>
</body>
</html>
Next time at least try to modify the code yourself please.
alphabeta
10-18-2005, 06:19 AM
People, people, the WMP embedded player isn't as customizable as you think it is. It is very limited to what you can do. Look around in this thread for the code that has the object tag in it.
I still want to say thank you! If not I would have tried doing things that it can't do :p ;)
_Aerospace_Eng_
10-18-2005, 06:23 AM
I edited my post.
alphabeta
10-18-2005, 06:47 AM
Next time at least try to modify the code yourself please.
I tried modifying with "top" etc. going bonkers trying to find the 'net for a solution, that's when I decided to ask you. I thank you again what a simple change ahh it's the UI mode and object tag http://img.lop.com/images/glp/images/smilies/s977.gif :p
Thank you! http://img.lop.com/images/glp/images/smilies/worship.gif _Aerospace_Eng_
alphabeta
10-18-2005, 08:33 AM
Hey Aero,
When I tried what you gave me the everything wokrs fine except that when I use the drop down menu the same playlist that keeps playing and playing again instead of the other playlist.
The changes I added are in red trying to troubleshoot it... no luck :confused:
<!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">
</style>
<script type="text/javascript">
<!--
numm3u = 2
day = new Date()
z = day.getTime()
y = (z - (parseInt(z/1000,10) * 1000))/10
x = parseInt(y/100*numm3u,10) + 1
if (x == (1))
m3u=("xxx")
if (x == (2))
m3u=("xxx2")
function song(){
document.getElementById('music1').innerHTML='<object width="271" height="60" '
+'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
+'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="url" value="'+m3u+'">'
+'<param name="url" value="getElementById(+cancion+).value">'
+'<param name="uiMode" value="full">'
+'<param name="autoStart" value="true">'
+'<param name="loop" value="true">'
+'<embed type="application/x-mplayer2" '
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="271" height="45" '
+'src="+getElementById('+cancion+').value+">'
+'src="'+m3u+'" autostart="true" loop="true">'
+'<\/object>';
}
//-->
</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="xxx">Album 1</option>
<option value="xxx2">Album 2</option>
</select><br><br>
<span id="music1">
<script type="text/javascript">
<!--
document.write('<object width="271" height="60" '
+'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
+'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="url" value="'+m3u+'">'
+'<param name="url" value="getElementById(+cancion+).value">'
+'<param name="uiMode" value="full">'
+'<param name="autoStart" value="true">'
+'<param name="loop" value="true">'
+'<embed type="application/x-mplayer2" '
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="271" height="45" '
+'src="+getElementById('+cancion+').value+">'
+'src="'+m3u+'" autostart="true" loop="true">'
+'<\/object>');
//-->
</script>
</span>
</div>
Thanks
alphabeta
10-19-2005, 05:12 AM
I got the code working with a playlist, random playlist/song on load, status bar on top, and selectable playlist/song, and looping. Tweaked what Aero gave me because the drop down box was not working on that one and looping the same playlist. Hopefully this helps someone too
<script type="text/javascript">
<!--
numm3u = 2
day = new Date()
z = day.getTime()
y = (z - (parseInt(z/1000,10) * 1000))/10
x = parseInt(y/100*numm3u,10) + 1
if (x == (1))
m3u=("xxx.m3u")
if (x == (2))
m3u=("xxx2.m3u")
function song(){
document.getElementById('music1').innerHTML='<object width="271" height="60" '
+'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
+'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="url" value="'+document.getElementById('cancion').value+'">'
+'<param name="uiMode" value="full">'
+'<param name="autoStart" value="true">'
+'<param name="playCount" VALUE="999">'
+'<param name="loop" value="true">'
+'<embed type="application/x-mplayer2" '
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="271" height="45" '
+'src="'+m3u+'" autostart="true" loop="true">'
+'<\/object>';
}
//-->
</script>
</head>
<body>
<div id="jukebox">JUKEBOX<br><br>
<select id="cancion" onchange="song()" size="1">
<option value="none">::::::::::::: Choose Album Here :::::::::::::</option>
<option value="xxx.m3u">xxx</option>
<option value="xxx2.m3u">xxx2</option>
</select><br><br>
<span id="music1">
<script type="text/javascript">
<!--
document.write('<object width="271" height="60" '
+'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
+'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="url" value="'+m3u+'">'
+'<param name="uiMode" value="full">'
+'<param name="autoStart" value="true">'
+'<param name="playCount" VALUE="999">'
+'<param name="loop" value="true">'
+'<embed type="application/x-mplayer2" '
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="271" height="45" '
+'src="'+m3u+'" autostart="true" loop="true">'
+'<\/object>');
//-->
</script>
</span>
</div>
_Aerospace_Eng_
10-19-2005, 06:02 AM
My bad, it was an object code I already had, forgot about the drop down. Change this
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="271" height="45" '
+'src="'+m3u+'" autostart="true" loop="true">'
+'<\/object>';
to this
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="271" height="45" '
+'src="'+document.getElementById('cancion').value+'" autostart="true" loop="true">'
+'<\/object>';
That should make it work in other browsers.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.