2008.12.08 00:53

 

Windows Media Player SDK banner art

콘트롤 참조
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 코드는 아래와 같다.

<OBJECT ID="Player"
  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)

Posted by 부니기
2008.07.22 21:42

Why Has the class ID Changed?

The correct class ID for Windows Media Player 7 and later is: clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6.

Many places on the internet it states that the class ID should be: clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95. This class ID is the old one, but it will work, because of backward compability. However, if you use the old class ID you will not be able to use the new features added to the component.

Class ID(CLSID) Value

Version CLSID Description
Windows Media Player 10
Windows Media Player 9
Windows Media Player 8
Windows Media Player 7
CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6 대부분의 시스템
(Windows 2000이후 기본 탑재)
Windows Media Player 6.4 CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95 일부 시스템에서만 사용한다. 단 호환성이 좋다.
(Windows XP이전버전까지 기본탑재됨)
Windows Media Player 6
(Older version)
CLSID:05589FA1-C356-11CE-BF01-00AA0055595A 지금은 거의 사용하지 않는다.

Parameter Discription

Windows Media Player provides a number of properties for use in monitoring and altering the state of the Player.

Following is a list of the properties exposed by the Windows Media Player.

Properties not supported are not listed. Unsupported properties can be accessed, but their values are not meaningful, and manipulating them will have no effect.

Property Access Value Description

AllowChangeDisplaySize

Read/Write

 

Sets or retrieves a value specifying whether the display size can be changed.

AllowHideControls

Read/Write

 

Indicates whether the user can hide the control panel at run time.

AllowScan

Read/Write

 

Sets or retrieves a value specifying whether scanning is enabled for files that support scanning (fast-forwarding and rewinding).

AudioStream

Read/Write

 

Sets or retrieves a value specifying the stream number of the current audio stream.

AutoRewind

Read/Write

 

Sets or retrieves a value specifying whether the Windows Media Player control automatically returns to the clip's starting point after the clip finishes playing or has otherwise stopped.

AutoSize

Read/Write

 

Sets or retrieves a value indicating whether the Windows Media Player control automatically sizes to the proportions of the original media rendered at the current display size.

AutoStart

Read/Write

 

Sets or retrieves a value specifying whether to start playing the clip automatically.

Balance

Read/Write

 

Sets or retrieves a value indicating the stereo balance.

Bandwidth

Read-only

 

Retrieves the bandwidth of the current clip in bits per second.

BaseURL

Read-only

 

Retrieves a value specifying the base URL.

BufferingCount

Read-only

 

Retrieves a value specifying the number of times buffering occurred during playback of a clip.

BufferingProgress

Read-only

 

Retrieves a value specifying the percentage of buffering completed.

BufferingTime

Read-only

 

Retrieves the buffering time, which is the time allocated for buffering incoming data before playback begins.

CanScan

Read-only

 

Retrieves a value specifying whether the current file supports scanning.

CanSeek

Read-only

 

Retrieves a value specifying whether the current file has the ability to seek to a specific time.

CanSeekToMarkers

Read-only

 

Retrieves a value specifying whether markers in the file can be located with a seek operation.

ChannelDescription

Read-only

 

Retrieves a value representing the station description.

ChannelName

Read-only

 

Retrieves a value representing the station name.

ChannelURL

Read-only

 

Retrieves a value representing the URL of the station metafile.

ClickToPlay

Read/Write

 

Sets or retrieves a value specifying whether the user can toggle playback by clicking the video image.

CodecCount

Read-only

 

Retrieves the number of installable codecs used by the current clip.

ContactAddress

Read-only

 

Retrieves a value representing the station's contact address.

ContactEmail

Read-only

 

Retrieves a value representing the station's e-mail address.

ContactPhone

Read-only

 

Retrieves a value representing the station's contact telephone number.

CreationDate

Read-only

 

Retrieves a value specifying the date and time when the clip was created.

CurrentMarker

Read/Write

 

Sets or retrieves a value indicating the current marker number.

CurrentPosition

Read/Write

 

Sets or retrieves a value representing the clip's current position, in seconds.

CurrentState

Read-only

 

Specifies the playback file's current state: stopped, paused, or running.

DefaultFrame

Read/Write

 

Sets or retrieves a value representing the default target HTTP frame.

DisplayBackColor

Read/Write

 

Sets or retrieves a value specifying the display panel's background color.

DisplayForeColor

Read/Write

 

Sets or retrieves a value specifying the display panel's foreground color.

DisplaySize

Read/Write

 

Sets or retrieves a value specifying the size of the image display window.

Duration

Read-only

 

Retrieves a value indicating the clip's playing time in seconds.

Enabled

Read/Write

 

Sets or retrieves a value specifying whether the Windows Media Player control is enabled.

EnablePositionControls

Read/Write

 

Sets or retrieves a value specifying whether the position controls are enabled on the control bar.

EnableTracker

Read/Write

 

Sets or retrieves a value specifying whether the trackbar control is enabled.

EntryCount

Read-only

 

Returns the number of entries contained in the current Advanced Stream Redirector (ASX) file.

ErrorCode

Read-only

 

Retrieves a value specifying the current error code.

ErrorCorrection

Read-only

 

Retrieves a value specifying the error correction type of the current clip.

ErrorDescription

Read-only

 

Retrieves a value specifying the description of the current error state.

FileName

Read/Write

 

Sets or retrieves a value specifying the name of the clip to play.

FullScreenMode

Read/Write

 

Expands the area of the playback panel to fill the entire screen.

GetMoreInfoURL

Read-only

 

Retrieves a URL to additional information about the presentation.

HasError

Read-only

 

Retrieves a value specifying whether the Windows Media Player control currently has an error.

HasMultipleItems

Read-only

 

Retrieves a value specifying whether the current clip contains multiple items (playlists).

ImageSourceHeight

Read-only

 

Retrieves a value specifying the original image height of the current clip, in pixels.

ImageSourceWidth

Read-only

 

Retrieves a value specifying the original image width of the current clip, in pixels.

InvokeURLs

Read/Write

 

Sets or retrieves a value specifying whether the Windows Media Player control automatically invokes URLs in a browser (URL flipping).

IsBroadcast

Read-only

 

Retrieves a value specifying whether the source is broadcast.

IsDurationValid

Read-only

 

Retrieves a value specifying whether the value of the Duration property is valid.

Language

Read/Write

 

Sets or retrieves a value specifying the current locale used for national language support.

LostPackets

Read-only

 

Retrieves a value specifying the number of packets lost during transmission of the stream.

MarkerCount

Read-only

 

Retrieves a value specifying the number of markers in the current clip.

MovieWindowSize

Read/Write

 

Specifies the size of the playback panel.

Mute

Read/Write

 

Sets or retrieves a value indicating the current mute state of the Windows Media Player control.

OpenState

Read-only

 

Retrieves a value indicating the state of the content source.

PlayCount

Read/Write

 

Sets or retrieves a value indicating the number of times a clip plays.

PlayState

Read-only

 

Retrieves a value indicating the state of the Windows Media Player operation.

Rate

Read/Write

 

Sets or retrieves a value specifying the clip's playback rate.

ReadyState

Read-only

 

Retrieves a value specifying the state of readiness of the Windows Media Player control.

ReceivedPackets

Read-only

 

Retrieves a value specifying the number of packets received.

ReceptionQuality

Read-only

 

Retrieves a value specifying the percentage of packets received in the last 30 seconds.

RecoveredPackets

Read-only

 

Retrieves a value specifying the number of packets recovered.

SelectionEnd

Read/Write

 

Sets or retrieves a value specifying the time when playback of the current clip will stop.

SelectionStart

Read/Write

 

Sets or retrieves a value specifying where playback of the current clip will begin.

SendErrorEvents

Read/Write

 

Sets or retrieves a value specifying whether the Windows Media Player control sends error events.

SendKeyboardEvents

Read/Write

 

Sets or retrieves a value specifying whether the Windows Media Player control sends keyboard events.

SendMouseClickEvents

Read/Write

 

Sets or retrieves a value specifying whether the Windows Media Player control sends mouse click events.

SendMouseMoveEvents

Read/Write

 

Sets or retrieves a value specifying whether the Windows Media Player control sends mouse move events.

SendOpenStateChangeEvents

Read/Write

 

Sets or retrieves a value specifying whether the Windows Media Player control sends open state change events.

SendPlayStateChangeEvents

Read/Write

 

Sets or retrieves a value specifying whether the Windows Media Player control sends play state change events.

ShowAudioControls

Read/Write

 

Sets or retrieves a value specifying whether the audio controls appear on the control bar.

ShowControls

Read/Write

 

Sets or retrieves a value specifying whether the control bar is visible.

ShowPositionControls

Read/Write

 

Sets or retrieves a value specifying whether the control bar is visible.

ShowStatusBar

Read/Write

 

Sets or retrieves a value specifying whether the status bar is visible.

ShowTracker

Read/Write

 

Sets or retrieves a value specifying whether the trackbar is visible.

SourceLink

Read-only

 

Retrieves a value specifying the path to the current clip.

SourceProtocol

Read-only

 

Retrieves a value specifying the protocol used to receive data.

StreamCount

Read-only

 

Retrieves a value indicating the number of media streams in the current clip.

TransparentAtStart

Read/Write

 

Sets or retrieves a value specifying whether the Windows Media Player control is transparent before play begins.

VideoBorder3D

Read/Write

 

Sets or retrieves a value specifying whether the three-dimensional video border effect is enabled.

VideoBorderColor

Read/Write

 

Sets or retrieves a value specifying the color of the video border.

VideoBorderWidth

Read/Write

 

Sets or retrieves a value specifying the width of the video border, in pixels.

Volume

Read/Write

 

Sets or retrieves a value specifying the volume, in hundredths of decibels.

       
Posted by 부니기

티스토리 툴바