|
-
December 5th, 2009, 10:26 AM
#1
axWindowsMediaPlayer
Ok, I saw too many posts regarding how to detect the end of a song using axWindowsMediaPlayer.
Alot say you have to watch the axWindowsMediaPlayer.status till it actually becomes "Stopped",
that is wrong... Why? What if the user presses the Stop button your application? It returns "Stopped" too, so that won't work.
axWindowsMediaPlayer.EndOfStream is still not good. But some people think it is.
Ok, so the trick is to use the axWindowsMediaPlayer.PlayStateChanged().
Basically, this will let you monitor every single state of your axWindowsMediaPlayer control.
Here is a list of all the states.
0 = Undefined
1 = Stopped (by User)
2 = Paused
3 = Playing
4 = Scan Forward
5 = Scan Backwards
6 = Buffering
7 = Waiting
8 = Media Ended
9 = Transitioning
10 = Ready
11 = Reconnecting
12 = Last
So, from that list you should know that you must use 8.
So, in the event we will do the following:
private void axWindowsMediaPlayer1_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) {
if (e.newState == 8) {
//Your Code Here
}
}
That's basically it.
Hope this helps alot of people,
But most importantly YOU The Reader!
ClayC
-
December 5th, 2009, 07:56 PM
#2
Re: axWindowsMediaPlayer
Thanks for the info, but these forums aren't for passing on data in this manner.
Consider turning this info into an article and submit it as a Code Guru article.
-
December 6th, 2009, 05:16 AM
#3
Re: axWindowsMediaPlayer
Sure thing, I will try to find the articles etc... I love to post tutorials as it makes life easier for everyone 
and please do check this link: http://www.codeguru.com/forum/showthread.php?t=489275
it's something I am working on 
Thanks for the tips,
ClayC
-
December 6th, 2009, 01:07 PM
#4
Re: axWindowsMediaPlayer
Yeah, I saw that. That fits into the product announcement forum. The forums under specific languages and/or technologies are for getting help, not for product announcements. Product announcements go into the Product Announcement forum.
-
December 8th, 2009, 03:17 PM
#5
Re: axWindowsMediaPlayer
Yeah I kinda learned that now 
btw this tutorial now is foun on this link
http://www.codeguru.com/article-preview.php/16597
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|