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

Before you post, read our: Rules & Posting Guidelines

Closed Thread
 
Thread Tools Rating: Thread Rating: 31 votes, 3.42 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-02-2005, 05:17 AM   PM User | #91
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
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.
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;
}
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
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;
}
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.

Last edited by _Aerospace_Eng_; 06-02-2005 at 05:20 AM..
_Aerospace_Eng_ is offline  
Old 06-18-2005, 03:12 PM   PM User | #92
numanme
New to the CF scene

 
Join Date: Jun 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
numanme is an unknown quantity at this point
help

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
numanme is offline  
Old 06-20-2005, 09:52 PM   PM User | #93
aswin_teja
New Coder

 
Join Date: Jun 2005
Location: india
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
aswin_teja is an unknown quantity at this point
Thumbs up gr8 !

whew!

7 pages full of discussion abt windoes media player streaming !! .. just lookd almost all pages .. n thanx peeps .. u really rock !!

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 wd b thankful


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
aswin_teja is offline  
Old 06-20-2005, 11:04 PM   PM User | #94
enumerator
Regular Coder

 
Join Date: May 2005
Posts: 313
Thanks: 0
Thanked 0 Times in 0 Posts
enumerator is an unknown quantity at this point
As mentioned, it's all documented: http://msdn.microsoft.com/library/en...audiovideo.asp
__________________
Thanks in advance!
enumerator is offline  
Old 06-21-2005, 07:50 AM   PM User | #95
aswin_teja
New Coder

 
Join Date: Jun 2005
Location: india
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
aswin_teja is an unknown quantity at this point
Lightbulb

thanx ! im on that
__________________
<<<<<<<ON SEARCH FOR MORE :) >>>>>>>
aswin_teja is offline  
Old 06-23-2005, 06:05 AM   PM User | #96
Secyrb
New Coder

 
Join Date: Jun 2005
Location: California
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Secyrb is an unknown quantity at this point
Myspace Video Player

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>
Secyrb is offline  
Old 06-24-2005, 04:23 AM   PM User | #97
bhavman2
New to the CF scene

 
Join Date: Jun 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
bhavman2 is an unknown quantity at this point
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...
bhavman2 is offline  
Old 06-24-2005, 05:37 AM   PM User | #98
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
@Secryb Use this
Code:
      <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.
_Aerospace_Eng_ is offline  
Old 06-24-2005, 05:52 AM   PM User | #99
Secyrb
New Coder

 
Join Date: Jun 2005
Location: California
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Secyrb is an unknown quantity at this point
But is there any way that you could choose a video to play from any sort of list or menu??
__________________
-Bryce
It doesn't matter how long my hair is or what colour my skin is or whether I'm a woman or a man. -John Lennon
Secyrb is offline  
Old 06-24-2005, 07:32 AM   PM User | #100
enumerator
Regular Coder

 
Join Date: May 2005
Posts: 313
Thanks: 0
Thanked 0 Times in 0 Posts
enumerator is an unknown quantity at this point
Link an iframe to load a new document (object/src) for each item...
__________________
Thanks in advance!
enumerator is offline  
Old 06-25-2005, 02:28 AM   PM User | #101
numanme
New to the CF scene

 
Join Date: Jun 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
numanme is an unknown quantity at this point
Smile

Quote:
Originally Posted by numanme
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
got the stop button working
numanme is offline  
Old 06-25-2005, 02:37 AM   PM User | #102
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
in Internet Explorer only right?
_Aerospace_Eng_ is offline  
Old 06-26-2005, 01:56 AM   PM User | #103
numanme
New to the CF scene

 
Join Date: Jun 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
numanme is an unknown quantity at this point
Yes only in Internet Explorer love to get it working in Firefox
numanme is offline  
Old 06-26-2005, 06:04 PM   PM User | #104
Secyrb
New Coder

 
Join Date: Jun 2005
Location: California
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Secyrb is an unknown quantity at this point
Quote:
Originally Posted by enumerator
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
__________________
-Bryce
It doesn't matter how long my hair is or what colour my skin is or whether I'm a woman or a man. -John Lennon
Secyrb is offline  
Old 06-26-2005, 06:43 PM   PM User | #105
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
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.
_Aerospace_Eng_ is offline  
Closed Thread

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:38 AM.


Advertisement
Log in to turn off these ads.