AxWindowsMediaPlayer媒体文件主要方法属性

enableContextMenu:Boolean; 启用/禁用右键菜单 
fullScreen:boolean; 是否全屏显示 
//播放器基本控制 
Ctlcontrols.play; 播放 
Ctlcontrols.pause; 暂停 
Ctlcontrols.stop; 停止 
Ctlcontrols.currentPosition:double; 当前进度 
Ctlcontrols.currentPositionString:string; 当前进度,字符串格式。如“00:23” 
Ctlcontrols.fastForward; 快进 
Ctlcontrols.fastReverse; 快退 
Ctlcontrols.next; 下一曲 
Ctlcontrols.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 
axWindowsMediaPlayer1.currentMedia.sourceURL; //获取正在播放的媒体文件的路径
axWindowsMediaPlayer1.currentMedia.name;          //获取正在播放的媒体文件的名称
axWindowsMediaPlayer1.Ctlcontrols.Play          播放  
axWindowsMediaPlayer1.Ctlcontrols.Stop          停止  
axWindowsMediaPlayer1.Ctlcontrols.Pause          暂停  
axWindowsMediaPlayer1.Ctlcontrols.PlayCount        文件播放次数  
axWindowsMediaPlayer1.Ctlcontrols.AutoRewind       是否循环播放  
axWindowsMediaPlayer1.Ctlcontrols.Balance         声道  
axWindowsMediaPlayer1.Ctlcontrols.Volume         音量  
axWindowsMediaPlayer1.Ctlcontrols.Mute          静音  
axWindowsMediaPlayer1.Ctlcontrols.EnableContextMenu    是否允许在控件上点击鼠标右键时弹出快捷菜单  
axWindowsMediaPlayer1.Ctlcontrols.AnimationAtStart    是否在播放前先播放动画  
axWindowsMediaPlayer1.Ctlcontrols.ShowControls      是否显示控件工具栏  
axWindowsMediaPlayer1.Ctlcontrols.ShowAudioControls    是否显示声音控制按钮  
axWindowsMediaPlayer1.Ctlcontrols.ShowDisplay       是否显示数据文件的相关信息  
axWindowsMediaPlayer1.Ctlcontrols.ShowGotoBar       是否显示Goto栏  
axWindowsMediaPlayer1.Ctlcontrols.ShowPositionControls  是否显示位置调节按钮  
axWindowsMediaPlayer1.Ctlcontrols.ShowStatusBar      是否显示状态栏  
axWindowsMediaPlayer1.Ctlcontrols.ShowTracker       是否显示进度条  
axWindowsMediaPlayer1.Ctlcontrols.FastForward       快进  
axWindowsMediaPlayer1.Ctlcontrols.FastReverse       快退  
axWindowsMediaPlayer1.Ctlcontrols.Rate          快进/快退速率  
axWindowsMediaPlayer1.AllowChangeDisplaySize 是否允许自由设置播放图象大小  
axWindowsMediaPlayer1.DisplaySize       设置播放图象大小  
    1-MpDefaultSize         原始大小  
    2-MpHalfSize           原始大小的一半  
    3-MpDoubleSize          原始大小的两倍  
    4-MpFullScreen          全屏  
    5-MpOneSixteenthScreen      屏幕大小的1/16  
    6-MpOneFourthScreen       屏幕大小的1/4  
    7-MpOneHalfScreen        屏幕大小的1/2  
axWindowsMediaPlayer1.ClickToPlay       是否允许单击播放窗口启动Media Player  

 

在视频播放之后,可以通过如下方式读取源视频的宽度和高度,然后设置其还原为原始的大小.
         private void ResizeOriginal()
         {
             int intWidth = axWindowsMediaPlayer1.currentMedia.imageSourceWidth;
             int intHeight = axWindowsMediaPlayer1.currentMedia.imageSourceHeight;
             axWindowsMediaPlayer1.Width = intWidth + 2;
             axWindowsMediaPlayer1.Height = intHeight + 2;
         }

 

 

AxWindowsMediaPlayer1.URL 中URL是表示要播放的文件名,取消了原来的Name属性.

AxWindowsMediaPlayer1.Ctlcontrols.play()播放,同样还有Pause,Stop等其他属性.

AxWindowsMediaPlayer1.settings.balance表示媒体播放的声道设置,0表示均衡,-1和1表示左右声道.

AxWindowsMediaPlayer1.currentMedia.duration 表示要播放的文件的时间长度.可用它获取文件长度.

AxWindowsMediaPlayer1.Ctlcontrols.currentPosition表示正在播放的文件的当前播放位置,可用这个属性来对媒体文件进行前进后退等设置.如

AxWindowsMediaPlayer1.Ctlcontrols.currentPosition+1 表示前进1个时间单位.

AxWindowsMediaPlayer1.settings.rate播放速率,一般乘以16后再显示kbps单位.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值