Using the Windows Media Player Control in a Web Page for version 11
.gif)
콘트롤 참조
http://msdn.microsoft.com/en-us/library/bb262657(VS.85).aspx
구버전 (Media Player 6.4)은 아래 링크를 참조
CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95
http://msdn.microsoft.com/en-us/library/aa908337.aspx
기본 object 코드는 아래와 같다.
CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<PARAM name="autoStart" value="True">
</OBJECT>
사용할 수 있는 각 인수들은 아래와 같다.
Player Object
| PARAM name | Internet Explorer |
Firefox with mime type application/x-ms-wmp |
Firefox with any other mime type |
|---|---|---|---|
| autoStart | yes | yes | yes |
| balance | yes | yes | yes |
| baseURL | yes | yes | yes |
| captioningID | yes | yes | yes |
| currentMarker | yes | yes | yes |
| currentPosition | yes | yes | yes |
| defaultFrame | yes | no | no |
| enableContextMenu | yes | yes | yes |
| enabled | yes | yes | yes |
| enableErrorDialogs | yes | yes | no |
| fileName | no | yes | yes |
| fullScreen | yes | no | no |
| invokeURLs | yes | no | no |
| mute | yes | yes | yes |
| playCount | yes | yes | no |
| rate | yes | yes | yes |
| SAMIFileName | yes | yes | yes |
| SAMILang | yes | yes | yes |
| SAMIStyle | yes | yes | yes |
| SRC | no | yes | yes |
| stretchToFit | yes | yes | no |
| URL | yes | yes | yes |
| volume | yes | yes | yes |
| windowlessVideo | yes | yes | yes |
위의 인수 중 fileName과 SRC는 Firefox plug-in에서 동작하지만 Internet Explorer에서는 동작하지 않는다. 그러므로 두 옵션을 함께 사용하도록 한다.
주로 사용하는 object control 이다.
속성(PARAM elements)
| Property | Description |
|---|---|
| cdromCollection | Retrieves the CdromCollection object. |
| closedCaption | Retrieves the ClosedCaption object. |
| controls | Retrieves the Controls object. |
| currentMedia | Specifies or retrieves the current Media object. |
| currentPlaylist | Specifies or retrieves the current Playlist object. |
| dvd | Retrieves the DVD object. |
| enableContextMenu * | Specifies or retrieves a value indicating whether to enable the context menu, which appears when the right mouse button is clicked. |
| enabled * | Specifies or retrieves a value indicating whether the Windows Media Player control is enabled. |
| error | Retrieves the Error object. |
| fullScreen * | Specifies or retrieves a value indicating whether video content is played back in full-screen mode. |
| isOnline | Retrieves a value indicating whether the user is connected to a network. |
| isRemote * | Retrieves a value indicating whether the Windows Media Player control is running in remote mode. |
| mediaCollection | Retrieves the MediaCollection object. |
| network | Retrieves the Network object. |
| openState | Retrieves a value indicating the state of the content source. |
| playerApplication * | Retrieves the PlayerApplication object when a remoted Windows Media Player control is running. |
| playlistCollection | Retrieves the PlaylistCollection object. |
| playState | Retrieves a value indicating the state of the Windows Media Player operation. |
| settings | Retrieves the Settings object. |
| status | Retrieves a value indicating the current status of Windows Media Player. |
| stretchToFit * | Specifies or retrieves a value indicating whether video will stretch to fit size of the Windows Media Player control video display. |
| uiMode * | Specifies or retrieves a value indicating which controls are shown in the user interface when Windows Media Player is embedded in a Web page. |
| URL | Specifies or retrieves the name of the clip to play. |
| versionInfo | Retrieves a String value specifying the version of the Windows Media Player. |
| windowlessVideo * | Specifies or retrieves a value indicating whether the Windows Media Player control renders video in windowless mode. |
* Not accessible to skins.
메소드(method)
| Method | Description |
|---|---|
| close | Releases Windows Media Player resources. |
| launchURL | Sends a URL to the user's default browser to be rendered. |
| newMedia | Creates a new Media object. |
| newPlaylist | Creates a new Playlist object. |
| openPlayer | Opens Windows Media Player using the specified URL. |
이벤트(Event)
The Player object supports the following events. Events marked with an asterisk (*) are not accessible to skins. For information about handling mouse and keyboard events in skins, see External Events.
| Event | Description |
|---|---|
| AudioLanguageChange | Occurs when the current audio language changes. |
| Buffering | Occurs when the Windows Media Player control begins or ends buffering. |
| CdromMediaChange | Occurs when a CD or DVD is inserted into or ejected from a CD or DVD drive. |
| Click * | Occurs when the user clicks a mouse button. |
| CurrentItemChange | Occurs when Controls.currentItem changes. |
| CurrentMediaItemAvailable | Occurs when a graphic metadata item in the current media item becomes available. |
| CurrentPlaylistChange | Occurs when something changes within the current playlist. |
| CurrentPlaylistItemAvailable | Occurs when the current playlist item becomes available. |
| Disconnect | Reserved for future use. |
| DomainChange | Occurs when the DVD domain changes. |
| DoubleClick * | Occurs when the user double-clicks a mouse button. |
| DurationUnitChange | Reserved for future use. |
| EndOfStream | Reserved for future use. |
| Error | Occurs when the Windows Media Player control has an error condition. |
| KeyDown * | Occurs when a key is pressed. |
| KeyPress * | Occurs when a key is pressed and then released. |
| KeyUp * | Occurs when a key is released. |
| MarkerHit | Occurs when a marker is reached. |
| MediaChange | Occurs when a media item changes. |
| MediaCollectionAttributeStringAdded | Occurs when an attribute value is added to the library. |
| MediaCollectionAttributeStringChanged | Occurs when an attribute value in the library is changed. |
| MediaCollectionAttributeStringRemoved | Occurs when an attribute value is removed from the library. |
| MediaCollectionChange | Occurs when the media collection changes. |
| MediaCollectionMediaAdded | Occurs when a media item is added to the local library. |
| MediaCollectionMediaRemoved | Occurs when a media item is removed from the local library. |
| MediaError | Occurs when the Media object has an error condition. |
| ModeChange | Occurs when a mode of Windows Media Player is changed. |
| MouseDown * | Occurs when a mouse button is pressed. |
| MouseMove * | Occurs when the mouse pointer is moved. |
| MouseUp * | Occurs when a mouse button is released. |
| NewStream | Reserved for future use. |
| OpenPlaylistSwitch | Occurs when a title on a DVD begins playing. |
| OpenStateChange | Occurs when the Windows Media Player control changes state. |
| PlaylistChange | Occurs when a playlist changes. |
| PlaylistCollectionChange | Occurs when something changes in the playlist collection. |
| PlaylistCollectionPlaylistAdded | Occurs when a playlist is added to the playlist collection. |
| PlaylistCollectionPlaylistRemoved | Occurs when a playlist is removed from the playlist collection. |
| PlaylistCollectionPlaylistSetAsDeleted | Reserved for future use. |
| PlayStateChange | Occurs when the play state of the Windows Media Player control changes. |
| PositionChange | Occurs when the current position of the media item has been changed. |
| ScriptCommand | Occurs when a synchronized command or URL is received. |
| StatusChange | Occurs when the status property changes value. |
| StringCollectionChange | Occurs when a string collection changes. |
| Warning | Reserved for future use. |
* Not accessible to skins. For information about handling mouse and keyboard events in skins, see Ambient Event Handlers.
Setting Object
The Settings object provides a way to modify various Windows Media Player settings by using the following properties and methods.
The Settings object supports the following properties.
| Property | Description |
| autoStart | Specifies or retrieves a value indicating whether the current media item begins playing automatically. |
| balance | Specifies or retrieves the current stereo balance. |
| baseURL | Specifies or retrieves the base URL used for relative path resolution with URL script commands that are embedded in media files. |
| defaultAudioLanguage | Retrieves the locale identifier (LCID) of the default audio language specified in Windows Media Player. |
| defaultFrame | Specifies or retrieves the name of the frame used to display a URL that is received in a ScriptCommand event. |
| enableErrorDialogs | Specifies or retrieves a value indicating whether error dialog boxes are shown automatically. |
| invokeURLs | Specifies or retrieves a value indicating whether URL events should launch a Web browser. |
| isAvailable | Retrieves whether a specified type of information is available or a specified action can be performed. |
| mediaAccessRights | Retrieves a value indicating the rights currently granted for library access. |
| mute | Specifies or retrieves a value indicating whether audio is muted. |
| playCount | Specifies or retrieves the number of times a media item will play. |
| rate | Specifies or retrieves the current playback rate. |
| volume | Specifies or retrieves the current volume. |
The Settings object supports the following methods.
| Method | Description |
|---|---|
| getMode | Determines whether the loop mode or shuffle mode is active. |
| requestMediaAccessRights | Requests a specified level of access to the library. |
| setMode | Sets the loop mode or shuffle mode to active or inactive. |
The Settings object is accessed through the following property.
Via
Object Model Reference for Scripting
(http://msdn.microsoft.com/en-us/library/bb249259(VS.85).aspx)