Javascript allows the media to play with the specified button

Source: Internet
Author: User

Because the media code of a windows mediaplayer can only be used in IE, the following code does not support FF. Function to control media playback through external buttons. Webjx. Com

<! 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 = gb2312">
<Title> untitled document </title>
</Head>

Webpage tutorial 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>
& Lt; param name = CursorType value = 32512 & gt;
<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://www.webjx.com/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 = "play" onClick = "play ()">
</Body>
</Html>
 

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.