|
-
May 9th, 2010, 09:22 AM
#1
AxWindowsMediaPlayer - Detect 'status changed' and act accordingly
Hi,
I'm making a radio streaming application, and I'm using the AxWindowsMediaPlayer control to play the radio stream.
Since the GUI is 'important' (well, more important than otherwise) in this application, I decided to stick the media player in a UserControl, together with a Play/Stop button and a Mute/Unmute button. I don't want the user to see the actual media player (well, the controls part), so I hide the user interface of the media player (uiMode = "none"), so the user only sees my own buttons. This way, I can control the look of the media player myself.
The problem now is that these buttons should react just like the real control buttons do. When the play button is clicked, the media player starts playing and the button is changed to a stop button. That's all fine.
However, the media player can also start/stop playing for other reasons, especially when using a stream. If the stream is not available it stops playing, but my play button will still look like a stop button, indicating that the player is still playing (while it's not).
So, I need some way to determine the status of the media player. I found the StatusChange event which I'm pretty sure I should use. But I'm not sure what property to use in this event to check whether the media player is currently playing, or stopped, or buffering, or muted, etc...
I know there is a 'status' property (string), but the MSDN says not to rely on this property because the strings might change at any time. Yet, it does not say what I should use instead...
Furthermore, the status also depends on the stream. For example, it says
Code:
Playing '<station name here>: 65 K bits/second
instead of just "playing" or "stopped" or whatever...
So, does anyone know how I can determine whether the media player is:
- playing or stopped
- muted or unmuted
so I can update the looks of my buttons accordingly..?
Thanks!
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
|