[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 336
  • Last Modified:

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.

Thanks!
0
majnun
Asked:
majnun
  • 3
  • 3
  • 2
1 Solution
 
armoghanCommented:
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.
0
 
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.
0
 
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?
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
armoghanCommented:
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..

0
 
The_BiochemistCommented:
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>
    <ENTRY>
        <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" />
    </ENTRY>
</ASX>



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

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/metafileplaylists.asp

Once created they can be fed directly into the player

Simple
0
 
majnunAuthor Commented:
Biochemist:

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?

Thanks!
0
 
The_BiochemistCommented:
I will try and find the project that I used it in and have a look... I can't remember off hand
0
 
The_BiochemistCommented:
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!)



0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now