VB .NET : cuing up mulitple files in a Windows Media Player object

I'm using the windows media player (v9) from the SDK, embedded as a control in a windows form.

I am implementing a drag drop from an array of filenames.

I know how to set the URL property to play a particular file, but how do I cue up mulitple files. I do not want to mess around with the user's media library, i just want to duplicate the drag and drop multiple files into the "Now Playing" section.

Also, an oddity, i have to rem out the following line that is created when dragging the control from the toolbox in Visual Studio to the form (wmp is the name of the windows media player object):

Me.wmp.enabled = True

Otherwise i get an error message.

Most important to me is figuring out the cuing up multiple files, if anyone understands why i need to rem out that line i'd be grateful.

Who is Participating?
been having a bit of a play and The answer is yes and no...

at first it doesn't add it to the playlists (on my computer anyway) but after using an individual playlist a few times (3-4 times) it does get added.

However using WMP to play ANYTHING will get it added to their playlists eventually... I have been doing a lot of WMP and WMP encoder projects recently and my playlists have become completely mangled.

The player unfortunately seems to have most of the inherant functionality of the propper WMP player you can download from MS including adding things to playlists... it just doesn't seem to bee too efficient at it!

I have also tried to find any extended elements that can be added to the ASX playlists mentioned previously to stop them being added but unfortunately not.

One thing you could try (sorry I ran out of time to look myself) though is to work out how to manipulate the WMP library i.e. check if the playlists that have been used are present in the library and then remove them - I know the functionality is available and should be documented somewhere around teh previous link I posted to MSDN as the WMP docuentation is VERY thurough (which is good gor MS!)

I dont get it fully.
Why dont you create a simple Queue of all the Files added and show them, introduce back and forward functionality and thats it.
majnunAuthor Commented:
Yes, I've thought of implementing a listbox with filenames, and stepping through them with custom forward and back buttons... however, I'd imagine that the windows media player object ought to have all that functionality built in.

If I can't find a solution using wmp i'll just create my own interface for it, but i'd rather just use the wmp object to do all the work if possible.
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

majnunAuthor Commented:
If I create my own interface, does the wmp object fire an event when the current song reaches its end so I can tell it to play the next song in my custom cue?
I have lost the code for the media player which I made, but i do remember it had the song finished and start events.
Other way could be to see if duration of the song is equal to the ran file. i.e. if Duration - Current File position = 0, then the file has ended..

I had to do a similar thing so I used playlists...

They are just a modified XML file as below:

<ASX version = "3.0">
<TITLE>Basic Playlist Demo</TITLE>
        <TITLE>An Entry in a basic playlist</TITLE>
        <AUTHOR>Microsoft Corporation</AUTHOR>
        <COPYRIGHT>(c)2000 Microsoft Corporation</COPYRIGHT>
        <REF HREF = "mms://proseware.com/path/Yourfile.wma" />

This is a link to MSDN where they have a section explaining them and how to use them.


Once created they can be fed directly into the player

majnunAuthor Commented:

I'm trying to avoid the custom playlist from showing up in the media player when used outside the application I am writing... a while ago i tried a similar approach and the playlist I added, actually showed up (in the windows media user data folder?) of the users profile... i don't want to "clutter" the users windows media player with playlists that I create with the application... do you know if the method you have suggested will have this problem?

I will try and find the project that I used it in and have a look... I can't remember off hand
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.