JavaScript lets the media play through the specified buttons

Source: Internet
Author: User

Because Windows-specific MediaPlayer media code only supports use in IE, the following code does not support FF. The function implementation controls the media playback through the external button. Webjx.com

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en"
"Http://www.w3.org/TR/html4/loose.dtd" >
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title> Untitled Document </title>

Web Teaching Network

<body>
<object classid=clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95 codebase= "http://activex.microsoft.com/activex/ Controls/mplayer
/en/nsmp2inf.cab#version=6,1,5,217 "
Id=mediaplayer type=application/x-oleobject width=210 height=240 standby= "Loading Microsoft Windows Media Player Components ... " Viewastext align=middle>
<param Name=audiostream value=-1>
<param name=autosize value=0>
<param Name=autostart value=0>
<param Name=animationatstart value=0>
<param Name=allowscan value=-1>
<param name=allowchangedisplaysize value=0>
<param Name=autorewind value=0>
<param name=balance value=0>
<param name=baseurl value= "" >
<param Name=bufferingtime value=5>
<param name=captioningid value= "" >
<param Name=clicktoplay value=0>
<param Name=cursortype value=32512>
<param name=currentposition value=-1>
<param Name=currentmarker value=0>
<param Name=defaultframe value=1>
<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=0>
<param Name=enablefullscreencontrols value=0>
<param Name=enabletracker value=1>
<param name=filename value= "Http:///music/sejie/000025.mp3" >
<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=0>
<param Name=selectionend value=true>
<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=1>
<param Name=showpositioncontrols value=1>
<param Name=showstatusbar value=1>
<param Name=showtracker value=1>
<param Name=transparentatstart value=0>
<param Name=videoborderwidth value=0>
<param Name=videobordercolor value=0>
<param Name=videoborder3d value=0>
<param Name=volume value=-1070>
<param Name=windowlessvideo value=1>
</object><br>
<script type= "Text/javascript" >
function Play () {
document.getElementById ("MediaPlayer"). Play ();
}
</script>
<input type= "button" value= "playing" onclick= "Play ()" >
</body>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.