Discussion:
Add Code to the AxWindowsMediaPlayer Controls
(too old to reply)
Gianluca1
2009-12-02 21:34:01 UTC
Permalink
Hi, this is my first post, and i thought the best people to help me out are
you MSDN forum users.

SCENARIO;
On my form i have the AxWindowsMediaPlayer1 embedded onto it. I have a
listbox which is the play list. Now what most of you are thinking is that i
can simply make a button to add songs (media files) to the listbox and make
another button to which will tell the AxWindowsMediaPlayer1 that the URL is
the selected item in the listbox.

I have had problems with using my own buttons. For example when i press the
pause button i made "the code is AxWindowsMediaPlayer1.Ctlcontrols.pause()"
yes it pauses but does not continue. The button "Next" skips to the next item
in the Listbox but the Previous button does not work. This is not a real
issue.

I dont want to use my own buttons.

PROBLEM;
The problem lies in what i want to do AxWindowsMediaPlayer1 to do. Is it
possible to double click on the AxWindowsMediaPlayer Play button and tell
that button to play the contents within the listbox? Is it possible for
AxWindowsMediaPlayer Next and Previous Controls to skip and go to the
previous track in the Listbox?

Does that make sense? I want to insert code into the AxWindowsMediaPlayer
controls so they play the contents from a listbox, eg. Of course i wont need
to code the slider, volume, etc as AxWindowsMediaPlayer would do that
automatically.

Can someone help me or find a solution for me
Many Thanks
Gianluca
Alessandro Angeli
2009-12-02 21:43:13 UTC
Permalink
From: "Gianluca1"

[...]
Post by Gianluca1
The problem lies in what i want to do
AxWindowsMediaPlayer1 to do. Is it possible to double
click on the AxWindowsMediaPlayer Play button and tell
that button to play the contents within the listbox? Is
it possible for AxWindowsMediaPlayer Next and Previous
Controls to skip and go to the previous track in the
Listbox?
You need to create a Playlist object (Player.newPlaylist())
to reflect the contents of your listbox, then tell the
player to play that (Player.currentPlaylist).

You will need to listen to the Player.MediaChange event to
track the selected item in the listbox.

When the contents of the listbox change, you will need to
update the playlist (not create a new one!).
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
Gianluca C
2009-12-03 22:57:26 UTC
Permalink
This post might be inappropriate. Click to display it.
Loading...