locked
PlayReady with MediaEngine

    Question

  • I'm building an app to play cyfered videos using PlayReady and MediaEngine. I'm using Media engine native C++ video playback sample as my base project. I made a c# runtime library based on the project Simple PlayReady Sample. To test, i'm using the Microsoft PlayReady Test Servers. I'm able to play audio but when i'm trying to play video, the media engine give me MF_MEDIA_ENGINE_EVENT_ERROR.

    I'm registering the follow handlers:

    var extensions = new Windows.Media.MediaExtensionManager();
    
                extensions.RegisterByteStreamHandler("Microsoft.Media.PlayReadyClient.PlayReadyByteStreamHandler", ".pyv", "PRvideo");
                extensions.RegisterByteStreamHandler("Microsoft.Media.PlayReadyClient.PlayReadyByteStreamHandler", ".pya", "PRaudio" );
                extensions.RegisterByteStreamHandler("Microsoft.Media.PlayReadyClient.PlayReadyByteStreamHandler", ".wma", "PRaudio");
                extensions.RegisterByteStreamHandler("Microsoft.Media.PlayReadyClient.PlayReadyByteStreamHandler", ".wmv", "PRvideo");
                extensions.RegisterByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler", ".ism", "text/xml");
                extensions.RegisterByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler", ".ism", "application/vnd.ms-sstr+xml");

    MediaProtectionManager has this:

     Windows.Foundation.Collections.PropertySet cpSystems = new Windows.Foundation.Collections.PropertySet();
                cpSystems.Add("{F4637010-03C3-42CD-B932-B48ADF3A6A54}", "Microsoft.Media.PlayReadyClient.PlayReadyWinRTTrustedInput"); //Playready
                _protectionManager.Properties.Add("Windows.Media.Protection.MediaProtectionSystemIdMapping", cpSystems);
                _protectionManager.Properties.Add("Windows.Media.Protection.MediaProtectionSystemId", "{F4637010-03C3-42CD-B932-B48ADF3A6A54}");

    MediaProtectionManager is added to the MediaEngine this way:

    		MediaPlayer::ThrowIfFailed(
                spAttributes->SetUINT32(MF_MEDIA_ENGINE_CONTENT_PROTECTION_FLAGS, 1)
                );
    
            MediaPlayer::ThrowIfFailed(
                spAttributes->SetUnknown(MF_MEDIA_ENGINE_DXGI_MANAGER, (IUnknown*) m_spDXGIManager.Get())
                );
    		
    
    		MediaPlayer::ThrowIfFailed(
                spAttributes->SetUnknown(MF_MEDIA_ENGINE_CONTENT_PROTECTION_MANAGER, (IUnknown*) mediaProtectionManager)
                );
    What am I doing wrong?


    Thursday, October 04, 2012 6:41 PM