embedding wmp10 into app, video not sizing to screen (tried put_stretchToFit)

  • Thread starter Thread starter rpatel4
  • Start date Start date
R

rpatel4

I'm running on a pocket pc, windows mobile 5, embedding media player
into my app.
But I can't seem to get the video to stretch to fit its window, or
shrink to to fit its window.
When the media is smaller than the screen, it remains centered at its
original size. When its larger than the screen, its getting clipped
off at the edges.


This is a segment of my code...
long APIENTRY PlayMedia(HWND hParent)
{
long res = 0;
// Get the window
CQMPHostWindow * pWindow =
CQMPHostWindow::m_QQWindowMap.FindEntry(hParent);
if (pWindow)
{
res = pWindow->OnPlay(); //this works fine as the vid
starts playing
pWindow->OnStretch2Fit();
}
return res;
}


long OnStretch2Fit()
{
VARIANT_BOOL fValue = -1; //tried value 'true' as well
m_spIPlayer->put_stretchToFit(fValue);
return 0;
}


Similarly, if the video res is larger than the screen portion I'm
alloting it, parts of the video are being clipped. Any idea on what
I'm doing wrong? Do I need to set something that allows the video to
be resized?
 
An update to the above. In the msdn documentation, put_stretchToFit
says 'Windows Media Player 10 Mobile: This method always returns
E_INVALIDARG.'

Also it appears the video is shrinking to fit the height, not the
width. Is there a way to get it to do both?
 
Back
Top