How to embed Windows Media Player in HTML document

How to embed Windows Media Player in HTML document

This document describes how to embed Windows Media Player in HTML document to play music or video, and includes the required code in HTML and JavaScript.

If you want to distribute your HTML document with your music or video as a stand-alone application, please try MioFactory.

Also, take the time to check our Desktop Alert solution. Thank you!

Windows Media Player Download
 Before to start, you should check the version of Windows Media Player installed on your computer. Version 6.4 is supported, but the latest version is recommended.
Windows Media Player
Download
If you need to install or update Windows Media Player, click on the logo to download the version of Windows Media Player compatible with your operating system.


Embedding Windows Media Player
 To embed an object in HTML document, the object class ID is required. The class ID for Windows Media Player 7, 9, 10 and 11 is clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6.

Insert the following code into your HTML document to embed Windows Media Player 7 and later:



In the URL parameter, you can specify a URL (for streaming) or a local file.

If you are using a Mio generator, you should include the video file in your application. Including video reduce bandwidth usage and bring a better user experience.

Most important parameters supported by Windows Media Player 7 and later:

ParameterDefaultDescription
autoStarttrueSpecifies or retrieves a value indicating whether the current media item begins playing automatically.
balance0Specifies the current stereo balance.
Values range from ?00 to 100.
baseURL Specifies the base URL used for relative path resolution with URL script commands that are embedded in media items.
captioningID0Specifies the name of the element displaying the captioning.
currentMarker0Specifies the current marker number.
currentPosition0Specifies the current position in the media item in seconds.
defaultFrame-Specifies the name of the frame used to display a URL.
enableContextMenutrueSpecifies a value indicating whether to enable the context menu, which appears when the right mouse button is clicked.
enabledfalseSpecifies whether the Windows Media Player control is enabled.
fullScreenfalseSpecifies whether video content is played back in full-screen mode.
InvokeURLstrueSpecifies a value indicating whether URL events should launch a Web browser.
MutefalseSpecifies if audio is muted.
PlayCount1Specifies the number of times a media item will play. Minimum value of one.
Rate1.0Specifies the playback rate.
0.5 equates to half the normal playback speed, 2 equates to twice.
stretchToFitfalseSpecifies whether video displayed by the control automatically sizes to fit the video window, when the video window is larger than the dimensions of the video image.
uiModefullSpecifies which controls are shown in the user interface.
Possible values: invisible, none, mini, full.
URL-Specifies the name of the media item to play.
You can specify a local filename or a URL.
VolumeLast settingZero specifies no volume and 100 specifies full volume.
windowlessVideofalseSpecifies or retrieves a value indicating whether the Windows Media Player control renders video in windowless mode.
When windowlessVideo is set to true, the Player control renders video directly in the client area, so you can apply special effects or layer the video with text.
Supported by Windows Media Player for Windows XP or later.


If you want to embed Windows Media Player 6.4 instead of the latest version, the class ID is clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95.
Controlling Windows Media Player from a JavaScript code
 You can control Windows Media Player from scripting.

Start playback:



Stop playback:



Find more information
  Using the Windows Media Player Control in a Web Page (MSDN)
Windows Media Player Object Model Reference (MSDN)

Distribute your media as a stand-alone application with MioFactory.
Try our software, most are freeware.

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值