I've just received my invitation to participate in beta testing of MSN Soapbox. MS's "me too" technology for YouTube. Unfortunately my test didn't went well at all. I remember I was able to view videos from Soapbox before (before I was invited) and it looked pretty cool. I guess I was viewing it in somewhat different way. Anyway, when I tried browsing the MSN Soapbox library I wasn't able to view ANY video at all. They all seemed to be streaming and I could here the sound playing, but the video window was all black, and sometimes saying "Loading..." when buffering. Well it's beta testing so maybe errors like this are acceptable. One suggestion I have of why could it possibly be black to me is that I don't have appropriate codec installed and though the DirectShow graph can't be built...(does it use DirectShow at all?).
Another tricky question on MSN Soapbox is it's video player. It doesn't look like Flash or WMP control to me. So I suppose that's something different. I've asked this question on WMTalk group and for now all we came up to is that that's not WPF/E for sure, as soapbox was released to beta a bit earlier then CTP of WPF/E was released. So I suppose that's some kind of custom ActiveX they are using...but why would they not use WMP embedded? If anybody has any clues please post them here! ;)
Wednesday, December 20, 2006
MSN Soapbox
Posted by
Shoniko
at
02:11
0
comments
Labels:
beta testing,
DirectShow,
Flash,
MSN,
MSN Soapbox,
SoapBox,
WMP,
WPF/E
DiggIt!
Del.icio.us
Wednesday, December 13, 2006
Customizing Windows Media Player appierence with UI plug-in
I recently had a project that had to customize the WMP's GUI. Not only withing Settings area, but should be able to paint anywhere on the WMP. Still, the WMP should think that it's an UI plugin, and be able to load/unload it on users' prompt.
As WMP does not expose any functionality for repainting itself, I had to figure out some way on how to do this. I've managed to implement this with a hook procedure. It is a pretty raw method, I think, and you can run it some troubles with different versions of WMP, maybe you'll have to create version for your plugin for each version of WMP. The troubles may be causes because of different looks of different versions of WMP. (WMP 10 and WMP 11 for example). But this is a working solution, and I don't know of any other so here it goes.
When you're creating a UI plugin, WMP calls Create method of your plug-in. It looks something like this:
HRESULT CYourPlugin::Create(HWND hwndParent, HWND *phwndWindow);
So the first parameter you have a parent window for the plugin. Logically it would pretty obvious that the parent for the plug-in is a WMP window, itself. But that's not really like that. To get the player window you'll have to do something like this:
HWND thePlayerWnd = GetParent(GetParent(GetParent(GetParent(hwndParent))));
yeah, there are a lof of windows within the WMP. So once you have the player's window, you can set a hook to listen to the messages that it receives like this:
DWORD threadID = GetCurrentThreadId();
HHOOK hook SetWindowsHookEx(WH_CALLWNDPROCRET, (HOOKPROC) MyHookProc, AfxGetInstanceHandle(), threadID);
Then you just monitor the messages sent to hook procedure and handle them on your as you wish. (please note that in this case messages will be sent to you AFTER WMP had processed them. That's because of WH_CALLWNDPROCRET flag).
when your plugin is being unloaded don't forget to unhook:
UnhookWindowsHookEx(hook);
That's it.
more info on hooks can be found here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/hooks.asp
more info on WMP UI plugins here:
http://msdn2.microsoft.com/en-us/library/aa393418.aspx
If anybody has any question/suggestions please fill free to post them here.
Posted by
Shoniko
at
09:46
0
comments