help me write a java script code to add sound file in html page and another to add video file in html page
js to add sound in html page
Started by edwin namisi, Apr 19 2010 01:06 AM
1 reply to this topic
#1
Posted 19 April 2010 - 01:06 AM
|
|
|
#2
Posted 19 April 2010 - 02:15 AM
Adding video file is simple. You will need to use <object> tag in HTML for embedding video file.
For audio file you have to use similar HTML tag and set its autoplay property to "true", so that the audio start playing when the page loads.
Hope this helps you.
<object id="MediaPlayer" width="320" height="240" classid="Class ID Value" standby="Loading Windows Media Player components..." type="application/x-oleobject">
<param name="FileName" value="Your Video File Path">
<param name="uiMode" value="none" />
<param name="stretchToFit" value="0" />
<param name="windowlessVideo" value="0" />
<param name="enabled" value="-1" />
<param name="enableContextMenu" value="0" />
<param name="currentPosition" value="50" />
<param name="ShowControls" value="true">
<param name="ShowDisplay" value="false">
<param name="autostart" value="true">
<embed type="application/x-mplayer2" src="Your Video File Path" name="MediaPlayer" width="320" height="240" showcontrols="1" showstatusbar="1" showdisplay="0" autostart="0"></embed>
</object>
For audio file you have to use similar HTML tag and set its autoplay property to "true", so that the audio start playing when the page loads.
Hope this helps you.
Programming Discussion :w00t:


Sign In
Create Account

Back to top









