请问用c#设计的windows窗体中能放播放器吗?需要哪个控件?谢谢了
来源:百度知道 编辑:UC知道 时间:2024/06/23 22:18:46
WMP控件,这里我只提供最新版的代码
右击工具箱->选择项(I)... -> 显示"选择工具箱项" -> COM组件 -> Windows Media Player wmp.dll 添加
axWindowsMediaPlayer1.windowlessVideo = false; //设为false后双击屏幕可以全屏
axWindowsMediaPlayer1.fullScreen = true; //设播放器全屏播放
axWindowsMediaPlayer1.URL = @"mms://192.168.0.102/vod/jingwei.wma";
axWindowsMediaPlayer1.Ctlcontrols.play(); //播放
axWindowsMediaPlayer1.Ctlcontrols.stop(); //停止
axWindowsMediaPlayer1.Ctlcontrols.pause(); //暂停
axWindowsMediaPlayer1.settings.autoStart = true; //自动播放
axWindowsMediaPlayer1.settings.mute = false; //静音
axWindowsMediaPlayer1.settings.volume = 100; // 音量 int 0 ~ 100 100 是最大音量
axWindowsMediaPlayer1.currentMedia.duration.ToString();//影片长度
axWindowsMediaPlayer1.Ctlcontrols.currentPosition = 30; //当前的播放位置 double
axWindowsMediaPlayer1.currentMedia.getItemInfo("Title");//标题
axWind