Help in adding audio stream in javascript through html (autostart prob)


New Member
Reaction score
I have added the following code in my html (without innerhtml) for playin an audio file.I had set the parameters autostart as false and 0 as i dont want autoplay.Till here it works perfectly fine(ie. no autoplay as i wanted).
<div id="Layer1">
  <OBJECT ID="MediaPlayer1" CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"  CODEBASE=" Version=5,1,52,701" STANDBY="Loading Microsoft Windows&reg; Media Player components..." TYPE="application/x-oleobject" width="280" height="50">
 <param name="fileName" value="  mehbooba/mehbooba.mp3">
 <param name="animationatStart" value="true">
 <param name="transparentatStart" value="true">
 <param name="autoStart" value="false">
 <param name="showControls" value="true">
 <param name="Volume" value="-300">
 <embed type="application/x-mplayer2" pluginspage=""  src=" mehbooba/mehbooba.mp3" name="MediaPlayer1" width=280 height=50 autostart=0 showcontrols=1 volume=-300>
Now what i wanted is instead of adding the above div tag in html directly , i wanted to add it dynamically in javascript using innerHTML property.So i modified my code as below
  var div_player=document.createElement("div"); = "absolute"; = "200px"; = "52px"; = t_player + "px"; t_player=t_player+400; = "140px";
    div_player.innerHTML="<OBJECT ID='MediaPlayer1' CLASSID='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' CODEBASE=' Version=5,1,52,701' STANDBY='Loading Microsoft Windows&reg; Media Player components...' TYPE='application/x-oleobject' width='280' height='50'><param name='fileName' value='"+file+"'><param name='animationatStart' value='true'><param name='transparentatStart' value='true'<param name='autoStart' value='false'><param name='showControls' value='true'><param name='Volume' value='-300'><embed type='application/x-mplayer2' pluginspage='' src='"+file+"' name='MediaPlayer1' width=280 height=50 autostart=0 showcontrols=1 volume=-300></OBJECT>"  ;
Now the player works fine but the only problem is that now it has autoplay ON which i dont want.IN the 1st code the autoplay was off as i wanted but here i dont know y its not set to OFF.

U can see the o/p of this at

---------- Post added 11-21-2010 at 06:49 AM ---------- Previous post was 11-20-2010 at 07:43 PM ----------

hey guys , sorry for trouble , i got it now.actually there was a small typing error. A '>' was missing just before the autoStart attribute thts y it was not working.Anyways thanks all of u