C#WindowsMediaPlayer的属性

来源:互联网 发布:淘宝c店代运营 编辑:程序博客网 时间:2024/05/28 16:22

基本属性]  
URL:String; 指定媒体位置,本机或网络地址
uiMode:String; 播放器界面模式,可为Full, Mini, None, Invisible(不计大小写)
playState:integer; 播放状态。这个属性改变时同时引发PlayStateChange事件与StateChange事件。取值范围为枚举型:WMPLib.WMPPlayState,它的成员如下:
  wmppsUndefined = 0;   //未知状态
  wmppsStopped = 1;    //播放停止
  wmppsPaused = 2;     //播放暂停
  wmppsPlaying = 3;     //正在播放
  wmppsScanForward = 4;   //向前搜索
  wmppsScanReverse = 5;   //向后搜索
  wmppsBuffering = 6;     //正在缓冲
  wmppsWaiting = 7;      //正在等待流开始
  wmppsMediaEnded = 8;    //播放流已结束
  wmppsTransitioning = 9;    //准备新的媒体文件
  wmppsReady = 10;      //播放准备就绪
  wmppsReconnecting = 11;   //尝试重新连接流媒体数据
  wmppsLast = 12;       //上一次状态,状态没有改变
  在PlayStateChange中写代码可以防止播放rmvb等非默认类型的问题(用wmppsReady)。
  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; 播放次数
  //顺序播放
  wmp.settings.setMode(“shuffle”, False)
  //随机播放
  wmp.settings.setMode(“shuffle”, True)
  //循环播放
  wmp.settings.setMode(“loop”, True)

[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”)

0 0
原创粉丝点击