matlab下WindowMediaPlayer测试使用

来源:互联网 发布:中国超级高铁计划知乎 编辑:程序博客网 时间:2024/06/08 00:44

首先我遇到了运行以后无法展示问题

当更改URL时,对应的window player PlayStateChange 增加语句,会加载出来

set(hObject.Peer,'Visible','on');

如果是要程序运行就出现,那么在UI里面的如下函数增加,其中activex3为对应的空间tag号

%% --- Executes just before lrcxjy is made visible.可视化之前运行部分function lrcxjy_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject    handle to figure% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% varargin   command line arguments to lrcxjy (see VARARGIN)% Choose default command line output for lrcxjyhandles.output = hObject;% Update handles structureguidata(hObject, handles);

set(handles.activex3.Peer,'Visible','on');

我现在还面临没有即使释放资源的问题。还在思考

************************后面的记录我测试使用查看的对象状态改变***********************************

***********set(hObject.Peer,'Visible','on');***********看不见window player PlayStateChange --mark by Xu__JiayuBackgroundColor: [0.9412 0.9412 0.9412]Callback: []CData: []Enable: 'on'Extent: [0 0 0.8000 0.3077]FontAngle: 'normal'FontName: 'MS Sans Serif'FontSize: 8FontUnits: 'points'FontWeight: 'normal'ForegroundColor: [0 0 0]HorizontalAlignment: 'center'KeyPressFcn: []ListboxTop: 1Max: 1Min: 0Position: [69.8000 26.8462 60.2000 13.3077]String: ''Style: 'text'SliderStep: [0.0100 0.1000]TooltipString: ''Units: 'characters'Value: 0BeingDeleted: 'off'ButtonDownFcn: []Children: [0x1 double]Clipping: 'on'CreateFcn: 'actxproxy(gcbo);'DeleteFcn: []BusyAction: 'queue'HandleVisibility: 'off'HitTest: 'on'Interruptible: 'on'Selected: 'off'SelectionHighlight: 'on'Type: 'uicontrol'UIContextMenu: []UserData: []Parent: 226.0079Tag: 'activex3'Visible: 'off'


*************PlayStateChange *************打开了文件E:\031302539lrc\notation\小背篓.txt51.68K sampleswindow player PlayStateChange --mark by Xu__JiayuURL: ''openState: 'wmposPlaylistChanging'playState: 'wmppsTransitioning'controls: [1x1 Interface.Windows_Media_Player.IWMPControls3]settings: [1x1 Interface.Windows_Media_Player.IWMPSettings2]currentMedia: []mediaCollection: [1x1 Interface.Windows_Media_Player.IWMPMediaCollection2]playlistCollection: [1x1 Interface.Windows_Media_Player.IWMPPlaylistCollection]versionInfo: '12.0.7601.19148'network: [1x1 Interface.Windows_Media_Player.IWMPNetwork]currentPlaylist: [1x1 Interface.Windows_Media_Player.IWMPPlaylist]cdromCollection: [1x1 Interface.Windows_Media_Player.IWMPCdromCollection]closedCaption: [1x1 Interface.Windows_Media_Player.IWMPClosedCaption2]isOnline: 1Error: [1x1 Interface.Windows_Media_Player.IWMPError]status: ''dvd: [1x1 Interface.Windows_Media_Player.IWMPDVD]enabled: 1fullScreen: 0enableContextMenu: 1uiMode: 'full'stretchToFit: 0windowlessVideo: 0isRemote: 0playerApplication: '错误: 对象返回了错误代码: 0xC00D0FD3'Peer: [1x1 uicontrol]window player PlayStateChange --mark by Xu__JiayuURL: ''openState: 'wmposOpeningUnknownURL'playState: 'wmppsTransitioning'controls: [1x1 Interface.Windows_Media_Player.IWMPControls3]settings: [1x1 Interface.Windows_Media_Player.IWMPSettings2]currentMedia: [1x1 Interface.Windows_Media_Player.IWMPMedia3]mediaCollection: [1x1 Interface.Windows_Media_Player.IWMPMediaCollection2]playlistCollection: [1x1 Interface.Windows_Media_Player.IWMPPlaylistCollection]versionInfo: '12.0.7601.19148'network: [1x1 Interface.Windows_Media_Player.IWMPNetwork]currentPlaylist: [1x1 Interface.Windows_Media_Player.IWMPPlaylist]cdromCollection: [1x1 Interface.Windows_Media_Player.IWMPCdromCollection]closedCaption: [1x1 Interface.Windows_Media_Player.IWMPClosedCaption2]isOnline: 1Error: [1x1 Interface.Windows_Media_Player.IWMPError]status: '正在连接...'dvd: [1x1 Interface.Windows_Media_Player.IWMPDVD]enabled: 1fullScreen: 0enableContextMenu: 1uiMode: 'full'stretchToFit: 0windowlessVideo: 0isRemote: 0playerApplication: '错误: 对象返回了错误代码: 0xC00D0FD3'Peer: [1x1 uicontrol]window player PlayStateChange --mark by Xu__JiayuURL: 'E:\031302539lrc\runtemp\UImid.wav'openState: 'wmposMediaOpen'playState: 'wmppsPlaying'controls: [1x1 Interface.Windows_Media_Player.IWMPControls3]settings: [1x1 Interface.Windows_Media_Player.IWMPSettings2]currentMedia: [1x1 Interface.Windows_Media_Player.IWMPMedia3]mediaCollection: [1x1 Interface.Windows_Media_Player.IWMPMediaCollection2]playlistCollection: [1x1 Interface.Windows_Media_Player.IWMPPlaylistCollection]versionInfo: '12.0.7601.19148'network: [1x1 Interface.Windows_Media_Player.IWMPNetwork]currentPlaylist: [1x1 Interface.Windows_Media_Player.IWMPPlaylist]cdromCollection: [1x1 Interface.Windows_Media_Player.IWMPCdromCollection]closedCaption: [1x1 Interface.Windows_Media_Player.IWMPClosedCaption2]isOnline: 1Error: [1x1 Interface.Windows_Media_Player.IWMPError]status: '正在播放“UImid”: 705 千比特/秒'dvd: [1x1 Interface.Windows_Media_Player.IWMPDVD]enabled: 1fullScreen: 0enableContextMenu: 1uiMode: 'full'stretchToFit: 0windowlessVideo: 0isRemote: 0playerApplication: '错误: 对象返回了错误代码: 0xC00D0FD3'Peer: [1x1 uicontrol]window player PlayStateChange --mark by Xu__JiayuURL: 'E:\031302539lrc\runtemp\UImid.wav'openState: 'wmposMediaOpen'playState: 'wmppsMediaEnded'controls: [1x1 Interface.Windows_Media_Player.IWMPControls3]settings: [1x1 Interface.Windows_Media_Player.IWMPSettings2]currentMedia: [1x1 Interface.Windows_Media_Player.IWMPMedia3]mediaCollection: [1x1 Interface.Windows_Media_Player.IWMPMediaCollection2]playlistCollection: [1x1 Interface.Windows_Media_Player.IWMPPlaylistCollection]versionInfo: '12.0.7601.19148'network: [1x1 Interface.Windows_Media_Player.IWMPNetwork]currentPlaylist: [1x1 Interface.Windows_Media_Player.IWMPPlaylist]cdromCollection: [1x1 Interface.Windows_Media_Player.IWMPCdromCollection]closedCaption: [1x1 Interface.Windows_Media_Player.IWMPClosedCaption2]isOnline: 1Error: [1x1 Interface.Windows_Media_Player.IWMPError]status: '已完成'dvd: [1x1 Interface.Windows_Media_Player.IWMPDVD]enabled: 1fullScreen: 0enableContextMenu: 1uiMode: 'full'stretchToFit: 0windowlessVideo: 0isRemote: 0playerApplication: '错误: 对象返回了错误代码: 0xC00D0FD3'Peer: [1x1 uicontrol]window player PlayStateChange --mark by Xu__JiayuURL: 'E:\031302539lrc\runtemp\UImid.wav'openState: 'wmposMediaOpen'playState: 'wmppsTransitioning'controls: [1x1 Interface.Windows_Media_Player.IWMPControls3]settings: [1x1 Interface.Windows_Media_Player.IWMPSettings2]currentMedia: [1x1 Interface.Windows_Media_Player.IWMPMedia3]mediaCollection: [1x1 Interface.Windows_Media_Player.IWMPMediaCollection2]playlistCollection: [1x1 Interface.Windows_Media_Player.IWMPPlaylistCollection]versionInfo: '12.0.7601.19148'network: [1x1 Interface.Windows_Media_Player.IWMPNetwork]currentPlaylist: [1x1 Interface.Windows_Media_Player.IWMPPlaylist]cdromCollection: [1x1 Interface.Windows_Media_Player.IWMPCdromCollection]closedCaption: [1x1 Interface.Windows_Media_Player.IWMPClosedCaption2]isOnline: 1Error: [1x1 Interface.Windows_Media_Player.IWMPError]status: '打开媒体'dvd: [1x1 Interface.Windows_Media_Player.IWMPDVD]enabled: 1fullScreen: 0enableContextMenu: 1uiMode: 'full'stretchToFit: 0windowlessVideo: 0isRemote: 0playerApplication: '错误: 对象返回了错误代码: 0xC00D0FD3'Peer: [1x1 uicontrol]window player PlayStateChange --mark by Xu__JiayuURL: 'E:\031302539lrc\runtemp\UImid.wav'openState: 'wmposMediaOpen'playState: 'wmppsStopped'controls: [1x1 Interface.Windows_Media_Player.IWMPControls3]settings: [1x1 Interface.Windows_Media_Player.IWMPSettings2]currentMedia: [1x1 Interface.Windows_Media_Player.IWMPMedia3]mediaCollection: [1x1 Interface.Windows_Media_Player.IWMPMediaCollection2]playlistCollection: [1x1 Interface.Windows_Media_Player.IWMPPlaylistCollection]versionInfo: '12.0.7601.19148'network: [1x1 Interface.Windows_Media_Player.IWMPNetwork]currentPlaylist: [1x1 Interface.Windows_Media_Player.IWMPPlaylist]cdromCollection: [1x1 Interface.Windows_Media_Player.IWMPCdromCollection]closedCaption: [1x1 Interface.Windows_Media_Player.IWMPClosedCaption2]isOnline: 1Error: [1x1 Interface.Windows_Media_Player.IWMPError]status: '已停止'dvd: [1x1 Interface.Windows_Media_Player.IWMPDVD]enabled: 1fullScreen: 0enableContextMenu: 1uiMode: 'full'stretchToFit: 0windowlessVideo: 0isRemote: 0playerApplication: '错误: 对象返回了错误代码: 0xC00D0FD3'Peer: [1x1 uicontrol]window player PlayStateChange --mark by Xu__JiayuURL: 'E:\031302539lrc\runtemp\UImid.wav'openState: 'wmposMediaChanging'playState: 'wmppsTransitioning'controls: [1x1 Interface.Windows_Media_Player.IWMPControls3]settings: [1x1 Interface.Windows_Media_Player.IWMPSettings2]currentMedia: [1x1 Interface.Windows_Media_Player.IWMPMedia3]mediaCollection: [1x1 Interface.Windows_Media_Player.IWMPMediaCollection2]playlistCollection: [1x1 Interface.Windows_Media_Player.IWMPPlaylistCollection]versionInfo: '12.0.7601.19148'network: [1x1 Interface.Windows_Media_Player.IWMPNetwork]currentPlaylist: [1x1 Interface.Windows_Media_Player.IWMPPlaylist]cdromCollection: [1x1 Interface.Windows_Media_Player.IWMPCdromCollection]closedCaption: [1x1 Interface.Windows_Media_Player.IWMPClosedCaption2]isOnline: 1Error: [1x1 Interface.Windows_Media_Player.IWMPError]status: '正在更改媒体...'dvd: [1x1 Interface.Windows_Media_Player.IWMPDVD]enabled: 1fullScreen: 0enableContextMenu: 1uiMode: 'full'stretchToFit: 0windowlessVideo: 0isRemote: 0playerApplication: '错误: 对象返回了错误代码: 0xC00D0FD3'Peer: [1x1 uicontrol]window player PlayStateChange --mark by Xu__JiayuURL: ''openState: 'wmposPlaylistOpenNoMedia'playState: 'wmppsReady'controls: [1x1 Interface.Windows_Media_Player.IWMPControls3]settings: [1x1 Interface.Windows_Media_Player.IWMPSettings2]currentMedia: [1x1 Interface.Windows_Media_Player.IWMPMedia3]mediaCollection: [1x1 Interface.Windows_Media_Player.IWMPMediaCollection2]playlistCollection: [1x1 Interface.Windows_Media_Player.IWMPPlaylistCollection]versionInfo: '12.0.7601.19148'network: [1x1 Interface.Windows_Media_Player.IWMPNetwork]currentPlaylist: [1x1 Interface.Windows_Media_Player.IWMPPlaylist]cdromCollection: [1x1 Interface.Windows_Media_Player.IWMPCdromCollection]closedCaption: [1x1 Interface.Windows_Media_Player.IWMPClosedCaption2]isOnline: 1Error: [1x1 Interface.Windows_Media_Player.IWMPError]status: '准备就绪'dvd: [1x1 Interface.Windows_Media_Player.IWMPDVD]enabled: 1fullScreen: 0enableContextMenu: 1uiMode: 'full'stretchToFit: 0windowlessVideo: 0isRemote: 0playerApplication: '错误: 对象返回了错误代码: 0xC00D0FD3'Peer: [1x1 uicontrol]


0 0