开发者

Is it possible to add items to my WMP 12 media Library without running an instance of WMP?

I am currently using WMP 12 as a DLNA server to my television. While I'm impressed with how hassle-free it was to set up, there are a few small annoyances about it. One of them being that it does not auto-update my library when new media files are added to my library source folders.

My overall goal is to have my WMP library auto-update with new items when they are placed in my library source folders.

I've searched for awhile but haven't found any ways of doing this.

I have looked into this area of the MS documentation: http://msdn.microsoft.com/en-us/library/dd562388(v=vs.85).aspx, but it seems like these are meant to be used with a running instance of WMP. I can't find a way to get an instance of my local mediaCollection object so that I can manually update it or add items to it (utilizing the wmp.dll seemed to be a dead end: Reference to wmp.dll (\windows\system32\wmp.dll))

I would prefer to do this using C# since I already have a C# windows service that tracks my media directory for unsupported file extensions. It would be ideal to wrap this functionality into the same service.

Am 开发者_运维百科I missing something simple? I'd appreciate any insight into controlling my WMP media library using a script or program, or any ideas on how to alternatively auto-update my media library.


There are two ways to use WMP in applications, hosted and remoted. As far as I can tell, only the remoted mode has access to the library and like you said, it requires WMP to be running. Basically neither will do what you want.

I would recommend looking into some other DLNA solutions. There is PS3 Media Server, Serviio and a multitude of others that offer comparable (or more) features and easy setup. Both of these servers support transcoding a wider range of file types and include compatibility modes for certain televisions which will let you playback more file formats without even transcoding.

Personally, I use Mediatomb, which is very customizable and scriptable, but it is Linux only.

If you still want to access WMP by remoting, the following posts are a good start:

  • How to interact with Windows Media Player in C#
  • http://social.msdn.microsoft.com/Forums/en-US/clr/thread/dbd43d7e-f3a6-4087-be06-df17e76b635d/ -- Shows how to do this from C#
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜