Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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

Posted on 2004-10-21
Medium Priority
Last Modified: 2012-05-05
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.

Question by:majnun
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
LVL 18

Expert Comment

ID: 12378288
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.

Author Comment

ID: 12380734
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.

Author Comment

ID: 12380811
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?
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 18

Expert Comment

ID: 12397183
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..


Expert Comment

ID: 12416192
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


Author Comment

ID: 12416387

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?


Expert Comment

ID: 12416508
I will try and find the project that I used it in and have a look... I can't remember off hand

Accepted Solution

The_Biochemist earned 2000 total points
ID: 12416765
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!)


Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question