代码如下:
private void as_MusicPlay_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (as_MusicPlay.playState == WMPLib.WMPPlayState.wmppsMediaEnded) { int stmp = lis_songsPlayer.SelectedIndex; stmp++; if (stmp > lSong.Count - 1) { lis_songsPlayer.SelectedIndex = 0; as_MusicPlay.URL = lSong[0]; } else { lis_songsPlayer.SelectedIndex = stmp; as_MusicPlay.URL = lSong[stmp]; } } if (as_MusicPlay.playState == WMPLib.WMPPlayState.wmppsReady) { as_MusicPlay.Ctlcontrols.play(); } }
哪位大神可以救救我...
这种错误码:0xC00D1054的解释是:Operation attempted in an invalid graph state.
应该是由于Windows Media Player自身的某些缺陷或者异常操作引起的。我没有找到什么好的解决办法,也许你可以尝试在网上搜索:“0xC00D1054”
虽然最后没有找到正确的解决方法,但是分给你了
hei, guys, please print the error info. It says it is com exception, you can catch the exception and then print the error info. May help you. Nice day.
楼主解决没?
已解决, 采用了一种另类的方法, 如果谁能帮我解决上面的问题, 一定感激不尽!
已经走到play()方法这里了 那证明前面应该没什么错误,你根据他的错误提示去百度上找下原因
楼主 解决了吗 我也遇到了 烦死了
算解决了, 换方法了, 用的是play自带的播放列表 q:2533405413
好像这是本身控件问题,所以我在自动播放这里,采用了用play自带歌单的功能,解决了该功能。
lSong.Add("http://www.duomi.com/third-ajaxthird-play?id=24729144"); lSong.Add("http://www.duomi.com/third-ajaxthird-play?id=12874764"); lSong.Add("http://www.duomi.com/third-ajaxthird-play?id=20602192"); lis_songsPlayer.Items.AddRange(new string[] { "music1", "music2", "music3" }); foreach (var item in lSong) { var songItem = as_MusicPlay.newMedia(item); as_MusicPlay.currentPlaylist.appendItem(songItem); } as_MusicPlay.Ctlcontrols.play();
楼主能发给我一份吗?