locked
PlayReady with mediaEngine problem

    Question

  • I’m building an windows 8 app that needs to play encrypted video using playready.For that I’m using the Media engine native C++ video playback sample (http://code.msdn.microsoft.com/windowsapps/Media-Engine-Playback-ce1c82f0 ) and files from http://playready.directtaps.net/ for testing. Now I’m able to play encrypted audio with no problem but not video.

    After some research I figured out that I’m not setting the MF_MEDIA_ENGINE_PLAYBACK_HWND or MF_MEDIA_ENGINE_OPM_HWND attribute to the MediaEngine. The problem is that I don’t know how to do it. I have tried to do spAttributes->SetUINT64(MF_MEDIA_ENGINE_PLAYBACK_HWND,0) and spAttributes->SetUINT64(MF_MEDIA_ENGINE_OPM_HWND ,0) but it gives me the error “MF_MEDIA_ENGINE_PLAYBACK_HWND is undefined” and "MF_MEDIA_ENGINE_OPM_HWND is undifined". I have included mfmediaengine.h but the error continues to appear. In documentation says that MF_MEDIA_ENGINE_OPM_HWND and MF_MEDIA_ENGINE_PLAYBACK_HWND support both Desktop and Windows Store Apps but if we look at mfmediaengine.h we see that MF_MEDIA_ENGINE_OPM_HWND and MF_MEDIA_ENGINE_PLAYBACK_HWND are only defined for desktop family apps.

    #pragma region Desktop Family
    #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
    EXTERN_GUID(MF_MEDIA_ENGINE_PLAYBACK_HWND,
    0xd988879b,0x67c9,0x4d92,0xba,0xa7,0x6e,0xad,0xd4,0x46,0x03,0x9d);
    EXTERN_GUID(MF_MEDIA_ENGINE_OPM_HWND,
    0xa0be8ee7, 0x0572, 0x4f2c, 0xa8, 0x01, 0x2a, 0x15, 0x1b, 0xd3, 0xe7, 0x26);
    EXTERN_GUID(MF_MEDIA_ENGINE_PLAYBACK_VISUAL,
    0x6debd26f,0x6ab9,0x4d7e,0xb0,0xee,0xc6,0x1a,0x73,0xff,0xad,0x15);
    #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
    #pragma endregion

    What am I doing wrong? What value should be in the second parameter of SetUINT64 ? Is this the right way to implement playready in the MediaEngine?

    The documentation is too poor in this matter...

    Thursday, October 25, 2012 10:40 AM

Answers

  • Hello,

    Unfortunately until we officially release some guidance on using PlayReady with the Media Engine I think that you have a very difficult task trying to figure out how to implement things correctly.

    One thing you might try is to use two MediaElement controls and swap back and forth between them. You can pre-queue the content in the Media Element by calling "pause" after setting the source.

    I hope this helps,

    James


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    • Marked as answer by Jesse Jiang Friday, November 09, 2012 6:25 AM
    Wednesday, November 07, 2012 12:41 AM
    Moderator

All replies

  • Hello,

    In a XAML Windows Store app there is no concept of an HWND so it is not possible to set these values. At this time we have not released any guidance on using PlayReady from the MediaEngine. You should use the MediaElement. Is there a specific reason that you want to use the Media Engine with PlayReady?

    Thanks,

    James


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Thursday, November 01, 2012 11:16 PM
    Moderator
  • For several reasons, MediaElement is not an option for my project. Since I'm able to play encrypted audio with mediaengine using playready, I should not be too far from playing video with it. Any sugestion?

    In my project, I have to switch between videos very fast ( seamlessly ), and with mediaElement that change makes the mediaElement flick. Another problem is that playready with mediaElement has a huge delay before starting playback even if the license and video are both already cached (there are no requests to the license or video server). All those problems with mediaElement are the reason to try mediaEngine. Any suggestion for a plan C?

    Thanks,

    António

    Tuesday, November 06, 2012 3:06 PM
  • Hello,

    Unfortunately until we officially release some guidance on using PlayReady with the Media Engine I think that you have a very difficult task trying to figure out how to implement things correctly.

    One thing you might try is to use two MediaElement controls and swap back and forth between them. You can pre-queue the content in the Media Element by calling "pause" after setting the source.

    I hope this helps,

    James


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    • Marked as answer by Jesse Jiang Friday, November 09, 2012 6:25 AM
    Wednesday, November 07, 2012 12:41 AM
    Moderator