AxWindowsMediaPlayer的详细用法

属性/方法名: 说明: 
[基本属性]   
URL:String; 指定媒体位置,本机或网络地址 
uiMode:String; 播放器界面模式,可为Full, Mini, None, Invisible 
playState:integer; 播放状态,1=停止,2=暂停,3=播放,6=正在缓冲,9=正在连接,10=准备就绪 
enableContextMenu:Boolean; 启用/禁用右键菜单 
fullScreen:boolean; 是否全屏显示 
[controls] wmp.controls //播放器基本控制 
controls.play; 播放 
controls.pause; 暂停 
controls.stop; 停止 
controls.currentPosition:double; 当前进度 
controls.currentPositionString:string; 当前进度,字符串格式。如“00:23” 
controls.fastForward; 快进 
controls.fastReverse; 快退 
controls.next; 下一曲 
controls.previous; 上一曲 
[settings] wmp.settings //播放器基本设置 
settings.volume:integer; 音量,0-100 
settings.autoStart:Boolean; 是否自动播放 
settings.mute:Boolean; 是否静音 
settings.playCount:integer; 播放次数 
[currentMedia] wmp.currentMedia //当前媒体属性 
currentMedia.duration:double; 媒体总长度 
currentMedia.durationString:string; 媒体总长度,字符串格式。如“03:24” 
currentMedia.getItemInfo(const string); 获取当前媒体信息"Title"=媒体标题,"Author"=艺术家,"Copyright"=版权信息,"Description"=媒体内容描述,"Duration"=持续时间(秒),"FileSize"=文件大小,"FileType"=文件类型,"sourceURL"=原始地址 
currentMedia.setItemInfo(const string); 通过属性名设置媒体信息 
currentMedia.name:string; 同 currentMedia.getItemInfo("Title") 
[currentPlaylist] wmp.currentPlaylist //当前播放列表属性 
currentPlaylist.count:integer; 当前播放列表所包含媒体数 
currentPlaylist.Item[integer]; 获取或设置指定项目媒体信息,其子属性同wmp.currentMedia

AxWindowsMediaPlayer控件的属性收藏

MediaPlayer1.Play          播放  
MediaPlayer1.Stop          停止  
MediaPlayer1.Pause          暂停  
MediaPlayer1.PlayCount        文件播放次数  
MediaPlayer1.AutoRewind       是否循环播放  
MediaPlayer1.Balance         声道  
MediaPlayer1.Volume         音量  
MediaPlayer1.Mute          静音  
MediaPlayer1.EnableContextMenu    是否允许在控件上点击鼠标右键时弹出快捷菜单  
MediaPlayer1.AnimationAtStart    是否在播放前先播放动画  
MediaPlayer1.ShowControls      是否显示控件工具栏  
MediaPlayer1.ShowAudioControls    是否显示声音控制按钮  
MediaPlayer1.ShowDisplay       是否显示数据文件的相关信息  
MediaPlayer1.ShowGotoBar       是否显示Goto栏  
MediaPlayer1.ShowPositionControls  是否显示位置调节按钮  
MediaPlayer1.ShowStatusBar      是否显示状态栏  
MediaPlayer1.ShowTracker       是否显示进度条  
MediaPlayer1.FastForward       快进  
MediaPlayer1.FastReverse       快退  
MediaPlayer1.Rate          快进/快退速率  
MediaPlayer1.AllowChangeDisplaySize 是否允许自由设置播放图象大小  
MediaPlayer1.DisplaySize       设置播放图象大小  
    1-MpDefaultSize         原始大小  
    2-MpHalfSize           原始大小的一半  
    3-MpDoubleSize          原始大小的两倍  
    4-MpFullScreen          全屏  
    5-MpOneSixteenthScreen      屏幕大小的1/16  
    6-MpOneFourthScreen       屏幕大小的1/4  
    7-MpOneHalfScreen        屏幕大小的1/2  
MediaPlayer1.ClickToPlay       是否允许单击播放窗口启动Media Player

http://blog.csdn.net/brouse8079/archive/2007/10/17/1829885.aspx

AxWindowsMediaPlayer常用属性

2008-03-18 21:28

2. Ctlcontrols属性

Ctlcontrols属性是AxWindowsMediaPlayer的一个重

要属性, 此控件中有许多常用成员。

(1) 方法play

用于播放多媒体文件,其格式为:

窗体名.控件名.Ctlcontrols.play()

如: AxWindowsMediaPlayer1.Ctlcontrols.play()

‘此处缺省窗体名是Me

(2) 方法pause

用于暂停正在播放的多媒体文件,其格式为:

窗体名.控件名.Ctlcontrols.pause()

如: AxWindowsMediaPlayer1.Ctlcontrols.pause()

(3) 方法stop

用于停止正在播放的多媒体文件,其格式为:

窗体名.控件名.Ctlcontrols.stop()

如: AxWindowsMediaPlayer1.Ctlcontrols.stop()

(4) 方法fastforward

用于将正在播放的多媒体文件快进,其格式为:

窗体名.控件名.Ctlcontrols.fastforward()

如:

AxWindowsMediaPlayer1.Ctlcontrols.forward()

(5) 方法fastreverse

窗体名.控件名.Ctlcontrols.fastreverse()

如:

AxWindowsMediaPlayer1.Ctlcontrols.fastreverse

()

6. 属性CurrentPosition

用于获取多媒体文件当前的播放进度,其值是数值类

型,使用格式为:

窗体名.控件名.Ctlcontrols.currentPosition

d1=AxWindowsMediaPlayer1.Ctlcontrols.currentPosi

tion

其中d1 是一个整型变量。

7. 属性Duration

用于获取当前多媒体文件的播放的总时间,其值为数

值类型,其使用格式为:

窗体名.控件名.currentMedia.duration

如:d2

=AxWindowsMediaPlayer1.currentMedia.duration

其中d2是一个整型变量。
controls.currentPositionString:string; 当前进

度,字符串格式。如“00:23”

属性/方法名: 说明: 
[基本属性]   
URL:String; 指定媒体位置,本机或网络地址 
uiMode:String; 播放器界面模式,可为Full, Mini,

None, Invisible 
playState:integer; 播放状态,1=停止,2=暂停,

3=播放,6=正在缓冲,9=正在连接,10=准备就绪

player.PlayStateChange += new AxWMPLib._WMPOCXEvents_PlayStateChangeEventHandler(player_PlayStateChange);

private void player_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e)
{
    // Test the current state of the player and display a message for each state.
    switch (e.newState)
    {
        case 0:    // Undefined
            currentStateLabel.Text = "Undefined";
            break;

case 1:    // Stopped
            currentStateLabel.Text = "Stopped";
            break;

case 2:    // Paused
            currentStateLabel.Text = "Paused";
            break;

case 3:    // Playing
            currentStateLabel.Text = "Playing";
            break;

case 4:    // ScanForward
            currentStateLabel.Text = "ScanForward";
            break;

case 5:    // ScanReverse
            currentStateLabel.Text = "ScanReverse";
            break;

case 6:    // Buffering
            currentStateLabel.Text = "Buffering";
            break;

case 7:    // Waiting
            currentStateLabel.Text = "Waiting";
            break;

case 8:    // MediaEnded
            currentStateLabel.Text = "MediaEnded";
            break;

case 9:    // Transitioning
            currentStateLabel.Text = "Transitioning";
            break;

case 10:   // Ready
            currentStateLabel.Text = "Ready";
            break;

case 11:   // Reconnecting
            currentStateLabel.Text = "Reconnecting";
            break;

case 12:   // Last
            currentStateLabel.Text = "Last";
            break;

default:
            currentStateLabel.Text = ("Unknown State: " + e.newState.ToString());
            break;
    }
}

 


enableContextMenu:Boolean; 启用/禁用右键菜单 
fullScreen:boolean; 是否全屏显示 
controls.currentPosition:double; 当前进度 
controls.fastForward; 快进 
controls.fastReverse; 快退 
controls.next; 下一曲 
controls.previous; 上一曲 
[settings] wmp.settings //播放器基本设置 
settings.volume:integer; 音量,0-100 
settings.autoStart:Boolean; 是否自动播放 
settings.mute:Boolean; 是否静音 
settings.playCount:integer; 播放次数 
[currentMedia] wmp.currentMedia //当前媒体属性 
currentMedia.duration:double; 媒体总长度 
currentMedia.durationString:string; 媒体总长度

,字符串格式。如“03:24” 
currentMedia.getItemInfo(const string); 获取当

前媒体信息"Title"=媒体标题,"Author"=艺术

家,"Copyright"=版权信息,"Description"=媒体内

容描述,"Duration"=持续时间(秒),"FileSize"=

文件大小,"FileType"=文件类型,"sourceURL"=原

始地址 
currentMedia.setItemInfo(const string); 通过属

性名设置媒体信息 
currentMedia.name:string; 同

currentMedia.getItemInfo("Title") 
[currentPlaylist] wmp.currentPlaylist //当前播

放列表属性 
currentPlaylist.count:integer; 当前播放列表所

包含媒体数 
currentPlaylist.Item[integer]; 获取或设置指定

项目媒体信息,其子属性同wmp.currentMedia

http://hi.baidu.com/spt1985/blog/item/544bcdde42a7015cccbf1a09.html

axWindowsMediaPlayer1控件怎么用?

就像QQ一样,有消息来就有声音提示。我用axWindowsMediaPlayer1来做声音播放器。但是我不知道axWindowsMediaPlayer1控件怎么用。哪位大侠能给个例子。axWindowsMediaPlayer1控件怎么用?


<fontcolor=#0000ff>答:没人理我


<fontcolor=#0000ff>答:用法教程http://dev.yesky.com/250/2063250.shtml


<fontcolor=#0000ff>答:msdn参考http://msdn2.microsoft.com/en-us/library/bb262038.aspx


<fontcolor=#0000ff>答:MSDN有WMP的SDK,另外,如果只是一小段声音的话,sndPlaySound函数是个不错的选择(.netframework2.0里在Microsoft.VisualBasic.Devices.Audio类里已经有相关的函数的.net版了,连声明API都省了~)


<fontcolor=#0000ff>答:http://msdn2.microsoft.com/en-us/library/bb262657.aspx

AxWindowsMediaPlayer Object (VB and C#)

The AxWindowsMediaPlayer object is the root object for the Windows Media Player control. It supports the properties, methods, and events listed in the following tables.

The AxWindowsMediaPlayer object supports the following properties.

Property Description
cdromCollection Gets an IWMPCdromCollection interface.
closedCaption Gets an IWMPClosedCaption interface.
Ctlcontrols Gets an IWMPControls interface.
Ctlenabled Gets or sets a value indicating whether the Windows Media Player control is enabled.
currentMedia Gets or sets the IWMPMedia interface that corresponds to the current media item.
currentPlaylist Gets or sets the current IWMPPlaylist interface.
dvd Gets an IWMPDVD interface.
enableContextMenu Gets or sets a value indicating whether to enable the context menu, which appears when the right mouse button is clicked.
Error Gets an IWMPError interface.
fullScreen Gets or sets a value indicating whether video content is played back in full-screen mode.
isOnline Gets a value indicating whether the user is connected to a network.
isRemote Not supported for .NET programming.
mediaCollection Gets an IWMPMediaCollection interface.
network Gets an IWMPNetwork interface.
openState Gets a value indicating the state of the content source.
playerApplication Not supported for .NET programming.
playlistCollection Gets an IWMPPlaylistCollection interface.
playState Gets a value indicating the state of the Windows Media Player operation.
settings Gets an IWMPSettings interface.
status Gets a value indicating the current status of Windows Media Player.
stretchToFit Gets or sets a value indicating whether video will stretch to fit size of the Windows Media Player control video display.
uiMode Gets or sets a value indicating which controls are shown in the user interface when Windows Media Player is embedded in a Web page.
URL Gets or sets the name of the clip to play.
versionInfo Gets a value that specifies the version of the Windows Media Player.
windowlessVideo Gets or sets a value indicating whether the Windows Media Player control renders video in windowless mode.
Method Description
close Releases Windows Media Player resources.
launchURL Sends a URL to the user‘s default browser to be rendered.
newMedia Returns an IWMPMedia interface for a new media item.
newPlaylist returns an IWMPPlaylist interface for a new playlist.
openPlayer Opens Windows Media Player using the specified URL.

The AxWindowsMediaPlayer object supports the following events.

Event Description
AudioLanguageChange Occurs when the current audio language changes.
Buffering Occurs when the Windows Media Player control begins or ends buffering.
CdromBurnError Occurs when a generic error happens during a CD burning operation.
CdromBurnMediaError Occurs when an error happens while burning an individual media item to a CD.
CdromBurnStateChange Occurs when a CD burning operation changes state.
CdromMediaChange Occurs when a CD or DVD is inserted into or ejected from a CD or DVD drive.
CdromRipMediaError Occurs when an error happens while ripping an individual track from a CD.
CdromRipStateChange Occurs when a CD ripping operation changes state.
Click Occurs when the user clicks a mouse button.
CreatePartnershipComplete Not supported for .NET programming.
CurrentItemChange Occurs when IWMPControls.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.
DeviceConnect Not supported for .NET programming.
DeviceDisconnect Not supported for .NET programming.
DeviceStatusChange Not supported for .NET programming.
DeviceSyncError Not supported for .NET programming.
DeviceSyncStateChange Not supported for .NET programming.
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.
FolderScanStateChange Occurs when a folder monitoring operation changes state.
KeyDown Occurs when a key is pressed.
KeyPress Occurs when a key is pressed and then released.
KeyUp Occurs when a key is released.
LibraryConnect Occurs when a library becomes available.
LibraryDisconnect Occurs when a library is no longer available.
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.
PlayerDockedStateChange Not supported for .NET programming.
PlayerReconnect Not supported for .NET programming.
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.
SwitchedToControl Not supported for .NET programming.
SwitchedToPlayerApplication Not supported for .NET programming.
Warning Reserved for future use.

Windows Media Player 11 SDK

This documentation describes the Microsoft® Windows Media® Player 11 Software Development Kit (SDK). The Windows Media Player SDK is one of the components of the Microsoft Windows SDK. Other media components include the Microsoft Media Foundation SDK, the Microsoft Windows Media Format SDK, and the Microsoft Windows Media Services SDK.

The Windows Media Player SDK documents programming technologies that can be used to extend the capabilities of Windows Media Player and Windows Media Player Mobile. These technologies are documented in the following sections:

Section Description
About the Windows Media Player SDK This section provides details about how to find specific information in the SDK. It includes a section about new features and information about how to use the samples included with the SDK.
Windows Media Player Object Model The Microsoft Windows Media Player control is a Microsoft ActiveX® control used for adding digital media playback capabilities to Web pages. It provides a programming interface for rendering digital media files and streams.
Windows Media Player Skins Skins are an XML-based technology used to customize the user interface of Windows Media Player. You can also use Windows Media Player Mobile skins to customize the user interface of Windows Media Player Mobile.
Windows Media Player Plug-ins Plug-ins are objects that extend Windows Media Player functionality in a variety of ways. Plug-in types include custom visualizations, user interface plug-ins, DSP plug-ins, rendering plug-ins. Windows Media Player Mobile plug-in support is also described in this section.
Windows Media Metafiles Metafiles are XML documents that provide information about a media item and its presentation. Metafiles can be used to organize media items into playlists that can include functionality for seamless stream switching, ad insertion, and other features.
Windows Media Playlists Playlists are files that use XML elements to define either a dynamic "smart" playlist of media items or a static set of media items.
Windows Media Player Online Stores Windows Media Player provides functionality that enables digital media content providers to integrate their services with Windows Media Player. Integration between the Player and an online digital media store enables the user to locate content, download and manage files, play content, and copy content to CDs or devices.
Windows Media Player Some features of the SDK apply to Windows Media Player, the Windows Media Player ActiveX control, and Windows Media Player Mobile. This section provides information about these features.
Glossary This section contains definitions of terms used throughout the SDK.
  • Note   Installing this SDK does not install Windows Media Player or Windows Media Player Mobile. You must have Windows Media Player installed to use the material in this SDK. Windows Media Player Mobile is a part of Windows Mobile, which is only available on a Pocket PC or Smartphone supplied by a device manufacturer or mobile operator.
时间: 2024-11-08 22:02:46

AxWindowsMediaPlayer的详细用法的相关文章

C#播放声音的四种方法 +AxWindowsMediaPlayer的详细用法

C#播放声音的四种方法 第一种是利用DirectX 1.安装了DirectX SDK(有9个DLL文件).这里我们只用到MicroSoft.DirectX.dll和 Microsoft.Directx.DirectSound.dll2.引入DirectX 的DLL文件的名字空间:  [C#] 纯文本查看 复制代码 ? 01 02 using Microsoft.DirectX; usingMicrosoft.DirectX.DirectSound; 3.建立设备Device dv=newDevi

Display:Block 详细用法

根据CSS规范的规定,每一个网页元素都有一个display属性,用于确定该元素的类型,每一个元素都有默认的display属性值,比如div元素,它的默认display属性值为"block",成为"块级"元素(block-level):而span元素的默认display属性值为"inline",称为"行内"元素. 块级元素: 动占据一定矩形空间,可以通过设置高度.宽度.内外边距等属性,来调整的这个矩形的样子: 行内元素: 自己的

DOM Style样式对象的详细用法

DOM Style样式对象的详细用法 HTML Style样式比较复杂,相应访问.修改方法也有所差异.参考相关资料,整理如下. 典型Html文件如下,有三种定义方式. <head>     <style type="text/css">                /* 内部样式 */       h3 {color:green;}     </style>             <!-- 外部样式 style.css -->    

文件/目录权限设置命令chmod的详细用法

chmod是文件/目录权限设置的命令,在Linux中经常遇到,本博文以下总结chmod的详细用法. Linux/Unix的档案调用权限分为三级,即档案拥有者user.群组group.其他other.u表示该档案的拥有者,g表示与该档案的拥有者属于同一个群体(group)者,o表示其他以外的人,a表示这三者皆是. + 表示增加权限.- 表示取消权限.= 表示唯一设定权限. r表示可读取,w表示可写入,x表示可执行. 举例说明: (1).将档案file1.txt 设为所有人皆可读取: chmod u

mysql中游标在存储过程中的详细用法

昨天写的一个东东,分享下给大家. drop PROCEDURE  if exists sp_cleanUserData; CREATE  PROCEDURE `sp_cleanUserData`() BEGIN /*定义游标*/ declare v_dt bigint(20) default 0 ; declare v_num INT DEFAULT 0; /*游标循环到末尾时给定义的常量赋值*/ declare cur_userId   CURSOR FOR select  userId fr

Linux中find、grep命令详细用法

在linux下面工作,有些命令能够大大提高效率.本文就向大家介绍find.grep命令,他哥俩可以算是必会的linux命令,我几乎每天都要用到他们.本文结构如下: find命令 find命令的一般形式 find命令的常用选项及实例 find与xargs grep命令 grep命令的一般形式 grep正则表达式元字符集(基本集) grep命令的常用选项及实例 1.find命令 find命令是一个无处不在命令,是linux中最有用的命令之一.find命令用于:在一个目录(及子目录)中搜索文件,你可以

SplitContainer 控件详细用法(转)

1.可以将 Windows 窗体 SplitContainer 控件看作是一个复合体,它是由一个可移动的拆分条分隔的两个面板.当鼠标指针悬停在该拆分条上时,指针将相应地改变形状以显示该拆分条是可移动的.使用 SplitContainer 控件,可以创建复合的用户界面(通常,在一个面板中的选择决定了在另一个面板中显示哪些对象).这种排列对于显示和浏览信息非常有用.拥有两个面板使您可以聚合不同区域中的信息,并且用户可以轻松地使用拆分条(也称为"拆分器")调整面板的大小.另外,还可以嵌套多个

chmod和chown命令详细用法

Linux下数字表示文件的操作权限(777,755,..) Linux下,查看某路径下用(ls -l)查看所有文件的详细属性列表时,会看到文件的操作权限,类似"drwxr-xr-x"的字符串. 这串字符可以分成4段理解,结构为"d + 文件所有者操作权限 + 文件所有者所在组操作权限 + 其余人的操作权限": 1,第一段:例子中字母"d",表示文件所在目录 2,第二段:例子中字符串"rwx",表示文件所有者对此文件的操作权限

Java包(Package)的详细用法(转)

Java包(Package)的详细用法 http://wenwen.soso.com/z/q229375145.htm 当一个大型程序交由数个不同的程序人员开发时,用到相同的类名是很有可能的,那么如果发生了这样的事件我们该怎么办那?,在我们java程序开发中为了避免上述事件,提供了一个包的概念(package),那么既然有了这样一种方法能避免上述事件,那么我们怎样使用package那?,使用方法很简单我们只需要在我们写的程序第一行使用package关键字来声明一个包就行了,例如我们来声明一个名为