"景先生毕设|www.jxszl.com

C# CloudMediaContext类代码示例

2023-12-29 17:44编辑: www.jxszl.com景先生毕设
本文整理汇总了C#中CloudMediaContext类的典型用法代码示例。如果您正苦于以下问题:C#CloudMediaContext类的具体用法?C#CloudMediaContext怎么用?C#CloudMediaContext使用的例子?这里精选的类代码示例或许可以为您提供帮助。 示例1:ClassInit publicstaticvoidClassInit(TestContextcontext) { //CreateCounters(); _mediaContext=WindowsAzureMediaServicesTestConfiguration.CreateCloudMediaContext(); IContentKeyAuthorizationPolicyOptionpolicyOption=null; for(inti=0;i<10;i++) { byte[]expectedKey=null; IContentKeycontentKey=GetKeyDeliveryUrlTests.CreateTestKey(_mediaContext,ContentKeyType.EnvelopeEncryption,outexpectedKey); policyOption=ContentKeyAuthorizationPolicyOptionTests.CreateOption(_mediaContext,String.Empty,ContentKeyDeliveryType.BaselineHttp,null,null,ContentKeyRestrictionType.Open); Listoptions=newList { policyOption }; GetKeyDeliveryUrlTests.CreateTestPolicy(_mediaContext,String.Empty,options,refcontentKey); UrikeyDeliveryServiceUri=contentKey.GetKeyDeliveryUrl(ContentKeyDeliveryType.BaselineHttp); Assert.IsNotNull(keyDeliveryServiceUri); stringrawkey=EncryptionUtils.GetKeyIdAsGuid(contentKey.Id).ToString(); _testData.Add(newTuple(keyDeliveryServiceUri,TokenServiceClient.GetAuthTokenForKey(rawkey),GetKeyDeliveryUrlTests.GetString(expectedKey))); } }
原文链接:http://www.jxszl.com/biancheng/C/556778.html