UpdatePlayReadyConfigurationXML() static private method

static private UpdatePlayReadyConfigurationXML ( Guid keyId, byte keyValue, Uri licenseAcquisitionUrl, string originalXmlConfiguration ) : string
keyId Guid
keyValue byte
licenseAcquisitionUrl Uri
originalXmlConfiguration string
return string
Ejemplo n.º 1
0
        private IAsset CreatePlayReadyProtectedSmoothAsset(IAsset clearSmoothAssetToProtect)
        {
            Guid keyId = Guid.NewGuid();

            byte[] keyValue = ContentKeyTests.GetRandomBuffer(16);
            string encryptionConfiguration = File.ReadAllText(WindowsAzureMediaServicesTestConfiguration.PlayReadyConfigWithContentKey);

            encryptionConfiguration = JobTests.UpdatePlayReadyConfigurationXML(keyId, keyValue, new Uri("http://www.fakeurl.com"), encryptionConfiguration);

            IJob            job            = _mediaContext.Jobs.Create("Add PlayReady Protection Job");
            IMediaProcessor mediaProcessor = JobTests.GetMediaProcessor(_mediaContext, WindowsAzureMediaServicesTestConfiguration.MpEncryptorName);
            ITask           task           = job.Tasks.AddNew("PlayReady Encryption Task", mediaProcessor, encryptionConfiguration, TaskOptions.ProtectedConfiguration);

            task.InputAssets.Add(clearSmoothAssetToProtect);
            task.OutputAssets.AddNew("PlayReady Protected Smooth", AssetCreationOptions.CommonEncryptionProtected);

            job.Submit();

            job.GetExecutionProgressTask(CancellationToken.None).Wait();

            job.Refresh();

            return(job.OutputMediaAssets[0]);
        }