在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
播放单首歌曲 player.URL = "歌曲文件路径"; player.Ctlcontrols.play();
添加多首歌曲到播放列表
IWMPPlaylist playList = player.playlistCollection.newPlaylist("MyPlayList"); //新建列表 IWMPMedia media; foreach (DataRow drItem in MusicSettings.DtMusic.Rows) { media = player.newMedia(drItem["路径"].ToString()); //参数为歌曲路径 playList.appendItem(media); } player.currentPlaylist = playList; player.Ctlcontrols.play(); //开始播放 或者直接在当前列表上添加 player.currentPlaylist.clear(); IWMPMedia media; foreach (DataRow drItem in MusicSettings.DtMusic.Rows) { media = player.newMedia(drItem["路径"].ToString()); //参数为歌曲路径 player.currentPlaylist.appendItem(media); }
设置播放器音量 player.settings.volume=100;
设置循环播放 player.settings.setMode("loop", true);
设置随机播放
player.settings.setMode("shuffle", true);
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论