最近更新的BLOG列表
最新更新的文章列表
精彩推荐列表
调用 WMP 播放流媒体
2008-03-30 22:37:48.0
PlayState 的值
0 =
1=停止
2=暂停中
3=正在播放
4=向前搜索
5=向后搜索
6=缓冲中
7=等待中
8=播放完毕
9=转换曲目
10=准备就绪
1=停止
2=暂停中
3=正在播放
4=向前搜索
5=向后搜索
6=缓冲中
7=等待中
8=播放完毕
9=转换曲目
10=准备就绪
Media Player Player.playState事件
| Value | State | Description |
| 0 | Undefined | Windows Media Player is in an undefined state. |
| 1 | Stopped | Playback of the current media item is stopped. |
| 2 | Paused | Playback of the current media item is paused. When a media item is paused, resuming playback begins from the same location. |
| 3 | Playing | The current media item is playing. |
| 4 | ScanForward | The current media item is fast forwarding. |
| 5 | ScanReverse | The current media item is fast rewinding. |
| 6 | Buffering | The current media item is getting additional data from the server. |
| 7 | Waiting | Connection is established, but the server is not sending data. Waiting for session to begin. |
| 8 | MediaEnded | Media item has completed playback. |
| 9 | Transitioning | Preparing new media item. |
| 10 | Ready | Ready to begin playing. |
| 11 | Reconnecting | Reconnecting to stream. |
if(haotingplay.playState == 1)
播放列表播放时,需要判断.是否播放完毕..
播放:
wmp1.URL := 'mms://live.cctv.com/livekids';
wmp1.controls.play;
wmp1.controls.play;
| 属性/方法名: | 说明: |
| [基本属性] | |
| 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 |
文章评论
[以下网友留言只代表其个人观点,不代表中华网的观点或立场]