I'm making a background app for MCE where I need to read and manipulate the current/active playlist.
I think I can do that through the Windows Media Player, and I have read elsewhere in this forum that you simply create an instance of the WindowsMediaPlayer like:
WindowsMediaPlayer
and then you should have access to all the WMP functionality.
But if I do that, it looks like I'm getting a new "empty" instance of WMP and not the one currently associated with MCE.
This works fine to access the MediaCollection containing e.g. all your PlayLists or all your albums, but I need the current playlist (e.g. the list of the songs in the current playing album)
Can anybody please tell me what I'm doing wrong or if I'm on the wrong track before I loose my hair?!?
THANKS !!!
(Testing on WIN7, developing using .NET/C#)
http://msdn.microsoft.com/en-us/library/dd564128(VS.85).aspx
But for some god-awful reason they use jscript for this example... Anyway, it exposes some of the objects and their attributes/methods.
-3.0 Ghz Phenom II BE, 4GB, GIGABYTE GA-MA785G-UD3H, Ceton InfiniTV 4, BD-Burner, ACHT-T ATX Clear case, W7 64bit -HP Slimline S3200T w/ MSI NX8500GT, Vista 32bit -HP Mini 11 (Atom/Ion, 2GB, 250GB, 6cell, Win7 32bit)
namaste3for some god-awful reason they use jscript for this example
Thanks for your reply namaste3, but the sample you link to shows how to use the player object not how to get it, which is my problem.
Any other suggestions or comments anyone?
WMPLib.WindowsMediaPlayer wplayer = new WMPLib.WindowsMediaPlayer(); wplayer.URL = "Some.mp3"; wplayer.controls.play();
etc...
Thanks again namaste3, but like I try to describe in my first message, this will give me a new and "empty" instance of the WindowsMediaPlayer object why the player.currentPlaylist is empty even if MCE is playing an album.
My problem is that I need to access the current/active playlist in MCE, which I think requires a reference to the WindowsMediaPlayer object inside MCE. (If possible at all!)
Ideas anybody ?
Thanks!
You need to create a "remoted WMP" instance - this will connect to the same instance of WMP that Media Center is using, rather than a new one. You may need to write something in C++ to interface with your app though, as the docs say you can't do it with managed code.
See the MSDN page here: http://msdn.microsoft.com/en-us/library/dd564264(VS.85).aspx
If you search for "remoting WMP" you'll find some stuff about C# - be aware that it relates to previous versions of WMP/Windows and won't neccessarily work!
Cheers,Andrew
Has anyone figured this out or have sample code? Ive been looking everywhere on how to get this working. I am trying to access the MCE instance of WMP to get currently playing song but I cannot seem to get remoting to work...
http://msdn.microsoft.com/en-us/library/dd564301(v=VS.85).aspx
"Samples for Microsoft Visual C++ demonstrate embedding the Windows Media Player ActiveX control, remoting the Player ActiveX control, and working with the library."
You can't do this with C#, you have to do it with C++