Exemplo n.º 1
0
        /// <summary>Initializes the PlayReady protection manager.</summary>
        private void InitializeMediaProtectionManager()
        {
            var mediaProtectionManager = new MediaProtectionManager();

            mediaProtectionManager.ComponentLoadFailed += OnMediaProtectionManagerComponentLoadFailed;
            mediaProtectionManager.ServiceRequested    += OnMediaProtectionManagerServiceRequested;

            // Set up the container GUID for the CFF format (used with DASH streams), see http://uvdemystified.com/uvfaq.html#3.2
            // The GUID represents MPEG DASH Content Protection using Microsoft PlayReady, see http://dashif.org/identifiers/protection/
            mediaProtectionManager.Properties["Windows.Media.Protection.MediaProtectionContainerGuid"] = "{9A04F079-9840-4286-AB92-E65BE0885F95}";

            // Set up the drm layer to use. Hardware DRM is the default, but not all older hardware supports this
            var supportsHardwareDrm = PlayReadyStatics.CheckSupportedHardware(PlayReadyHardwareDRMFeatures.HardwareDRM);

            if (!supportsHardwareDrm)
            {
                mediaProtectionManager.Properties["Windows.Media.Protection.UseSoftwareProtectionLayer"] = true;
            }

            // Set up the content protection manager so it uses the PlayReady Input Trust Authority (ITA) for the relevant media sources
            // The MediaProtectionSystemId GUID is format and case sensitive, see https://msdn.microsoft.com/en-us/library/windows.media.protection.mediaprotectionmanager.properties.aspx
            var cpsystems = new PropertySet();

            cpsystems[PlayReadyStatics.MediaProtectionSystemId.ToString("B").ToUpper()] = "Windows.Media.Protection.PlayReady.PlayReadyWinRTTrustedInput";
            mediaProtectionManager.Properties["Windows.Media.Protection.MediaProtectionSystemIdMapping"] = cpsystems;
            mediaProtectionManager.Properties["Windows.Media.Protection.MediaProtectionSystemId"]        = PlayReadyStatics.MediaProtectionSystemId.ToString("B").ToUpper();

            Player.ProtectionManager = mediaProtectionManager;
        }
Exemplo n.º 2
0
 private async Task RefreshPlayreadyStats()
 {
     await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
     {
         txtSL.Text             = PlayReadyStatics.PlayReadyCertificateSecurityLevel.ToString();
         txtHasHardwareDRM.Text = PlayReadyStatics.CheckSupportedHardware(PlayReadyHardwareDRMFeatures.HardwareDRM).ToString();
         txtHasHEVCSupport.Text = PlayReadyStatics.CheckSupportedHardware(PlayReadyHardwareDRMFeatures.HEVC).ToString();
     });
 }
 public async void RefreshStatics()
 {
     var dispatcher = CoreApplication.MainView.CoreWindow.Dispatcher;
     await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         try
         {
             SecurityLevel            = PlayReadyStatics.PlayReadyCertificateSecurityLevel;
             PlayReadySecurityVersion = PlayReadyStatics.PlayReadySecurityVersion;
             HasHardwareDRM           = PlayReadyStatics.CheckSupportedHardware(PlayReadyHardwareDRMFeatures.HardwareDRM);
             HasHEVCSupport           = PlayReadyStatics.CheckSupportedHardware(PlayReadyHardwareDRMFeatures.HEVC);
         }
         catch
         {
             ViewModelBase.Log("PlayReadyStatics not yet available");
         }
     });
 }