void ServiceRequested(MediaProtectionManager sender, ServiceRequestedEventArgs srEvent) { serviceCompletionNotifier = srEvent.Completion; IPlayReadyServiceRequest serviceRequest = (IPlayReadyServiceRequest)srEvent.Request; ViewModelBase.Log(serviceRequest.GetType().Name); ProcessServiceRequest(serviceRequest); }
void instance_ChildServiceRequested(object sender, ServiceRequestedEventArgs e) { Edge.Core.Services.ServiceInstance instance = (Edge.Core.Services.ServiceInstance)sender; //e.RequestedService.OutcomeReported += new EventHandler(instance_OutcomeReported); e.RequestedService.StateChanged += new EventHandler <ServiceStateChangedEventArgs>(child_instance_StateChanged); e.RequestedService.Initialize(); }
void ProtectionManager_ServiceRequested(MediaProtectionManager sender, ServiceRequestedEventArgs srEvent) { _serviceCompletionNotifier = srEvent.Completion; IPlayReadyServiceRequest serviceRequest = (IPlayReadyServiceRequest)srEvent.Request; _requestChain = new RequestChain(serviceRequest); _requestChain.LicenseRequestUri = new Uri(LAURL); _requestChain.RequestConfigData = this.RequestConfigData; _requestChain.FinishAndReportResult(new ReportResultDelegate(HandleServiceRequest_Finished)); }
void ProtectionManager_ServiceRequested(MediaProtectionManager sender, ServiceRequestedEventArgs srEvent) { TestLogger.LogMessage("Enter Playback.ProtectionManager_ServiceRequested()"); _serviceCompletionNotifier = srEvent.Completion; IPlayReadyServiceRequest serviceRequest = ( IPlayReadyServiceRequest )srEvent.Request; TestLogger.LogMessage("Servie request type = " + serviceRequest.GetType()); _requestChain = new RequestChain(serviceRequest); _requestChain.RequestConfigData = this.RequestConfigData; _requestChain.FinishAndReportResult(new ReportResultDelegate(HandleServiceRequest_Finished)); TestLogger.LogMessage("Leave Playback.ProtectionManager_ServiceRequested()"); }
void Instance_ChildServiceRequested(object sender, ServiceRequestedEventArgs e) { ServiceDisplayInfo step = this.Children.Single(item => item.Name == e.ServiceName); if (step != null) { step.Start(e.RequestedService); } else { step = new ServiceDisplayInfo(e.RequestedService.Configuration) { Unplanned = true }; step.Start(e.RequestedService); this.Children.Add(step); } }
void instance_ChildServiceRequested(object sender, ServiceRequestedEventArgs e) { Console.WriteLine(e.RequestedService); ServiceInstance instance = e.RequestedService; instance.StateChanged += new EventHandler <ServiceStateChangedEventArgs>(instance_StateChanged); instance.OutcomeReported += new EventHandler(instance_OutcomeReported); instance.ChildServiceRequested += new EventHandler <ServiceRequestedEventArgs>(instance_ChildServiceRequested); instance.ProgressReported += new EventHandler(instance_ProgressReported); instance.Initialize(); if (e.RequestedService.Configuration.Options["IsStep"] != null) { int sessionID = int.Parse(e.RequestedService.ParentInstance.ParentInstance.Configuration.Options["SessionID"]); lock (StepInstances) StepInstances[sessionID] = e.RequestedService; } if (e.RequestedService.Configuration.Options["WizardRole"] == "ExecutorContainer") { int sessionID = int.Parse(e.RequestedService.ParentInstance.Configuration.Options["SessionID"]); lock (MainExecuters) MainExecuters[sessionID] = e.RequestedService; } if (e.RequestedService.ParentInstance.Configuration.Options["WizardRole"] == "ExecutorContainer") { int sessionID = int.Parse(e.RequestedService.ParentInstance.ParentInstance.Configuration.Options["SessionID"]); lock (ExecuterSteps) { if (ExecuterSteps.ContainsKey(sessionID)) { ExecuterSteps[sessionID].Add(e.RequestedService); } else { List <ServiceInstance> listOfServiceInstances = new List <ServiceInstance>(); listOfServiceInstances.Add(e.RequestedService); ExecuterSteps.Add(sessionID, listOfServiceInstances); } } } }
/// <summary> /// Add a service /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void service_ChildServiceRequested(object sender, ServiceRequestedEventArgs e) { //_scheduleTable.Timer.Enabled = false; _scheduleTable.RunTaskSync.WaitOne(); // Init service ServiceInstance service = e.RequestedService; if (service.Configuration.IsEnabled) { // DORON - we might lose this wat the connection to the father. // If the service have no rule we add it with TimeScheduled = now. if (service.Configuration.SchedulingRules.Count == 0) { //service.InstanceType = ServiceInstanceType.Normal; service.TimeScheduled = DateTime.Now; service.ActiveSchedulingRule = null; // Remove the service' events and remove it from the relevent service List. service.StateChanged += _stateChangedHandler; service.OutcomeReported += _outcomeReportedHandler; service.ChildServiceRequested += _childServiceRequestedHandler; _scheduleTable.AddService(service); } else { AddServicesByRules(service); } } else { Log.Write(string.Format("Parent service: {0} with Instance ID : {1} CAN'T activated service: {2} with instance ID: {3} because it is no enable.", service.ParentInstance.Configuration.Name, service.ParentInstance.InstanceID, service.Configuration.Name, service.InstanceID), LogMessageType.Information); } //_scheduleTable.Timer.Enabled = true; _scheduleTable.RunTaskSync.Release(); }
private async void OnMediaProtectionManagerServiceRequested(MediaProtectionManager sender, ServiceRequestedEventArgs e) { Debug.WriteLine("ProtectionManager ServiceRequested"); var completionNotifier = e.Completion; var request = (IPlayReadyServiceRequest)e.Request; var result = false; if (request.Type == PlayReadyStatics.IndividualizationServiceRequestType) { result = await PlayReadyLicenseHandler.RequestIndividualizationToken(request as PlayReadyIndividualizationServiceRequest); } else if (request.Type == PlayReadyStatics.LicenseAcquirerServiceRequestType) { // NOTE: You might need to set the request.ChallengeCustomData, depending on your Rights Manager. if (!string.IsNullOrEmpty(arguments.RightsManagerUrl)) { request.Uri = new Uri(arguments.RightsManagerUrl); } result = await PlayReadyLicenseHandler.RequestLicense(request as PlayReadyLicenseAcquisitionServiceRequest); } completionNotifier.Complete(result); }
private async void OnMediaProtectionManagerServiceRequested(MediaProtectionManager sender, ServiceRequestedEventArgs e) { Debug.WriteLine("ProtectionManager ServiceRequested"); _serviceCompletionNotifier = e.Completion; IPlayReadyServiceRequest serviceRequest = (IPlayReadyServiceRequest)e.Request; Debug.WriteLine("Servie request type = " + serviceRequest.GetType()); var result = false; if (serviceRequest.Type == PlayReadyStatics.IndividualizationServiceRequestType) { result = await PlayReadyLicenseHandler.RequestIndividualizationToken(serviceRequest as PlayReadyIndividualizationServiceRequest); } else if (serviceRequest.Type == PlayReadyStatics.LicenseAcquirerServiceRequestType) { // NOTE: You might need to set the request.ChallengeCustomData, depending on your Rights Manager. if (RequestConfigData != null) { _requestChain = new RequestChain(serviceRequest); _requestChain.RequestConfigData = this.RequestConfigData; _requestChain.FinishAndReportResult(HandleServiceRequest_Finished); return; } else { result = await PlayReadyLicenseHandler.RequestLicense(serviceRequest as PlayReadyLicenseAcquisitionServiceRequest); } } _serviceCompletionNotifier.Complete(result); }
void LegacyInstance_ChildServiceRequested(object sender, ServiceRequestedEventArgs e) { e.RequestedService.Initialize(); }
private async void ProtectionManager_ServiceRequested(MediaProtectionManager sender, ServiceRequestedEventArgs e) { Log("Enter ProtectionManager_ServiceRequested"); if (e.Request is PlayReadyIndividualizationServiceRequest) { var individualizationRequest = e.Request as PlayReadyIndividualizationServiceRequest; bool bResultIndiv = await ReactiveIndividualizationRequestAsync(individualizationRequest, e.Completion); } else if (e.Request is PlayReadyLicenseAcquisitionServiceRequest) { var licenseRequest = e.Request as PlayReadyLicenseAcquisitionServiceRequest; LicenseAcquisitionRequest(licenseRequest, e.Completion, playReadyLicenseUrl, playReadyChallengeCustomData); } Log("Leave ProtectionManager_ServiceRequested"); }
private async void ProtectionManager_ServiceRequested(MediaProtectionManager sender, ServiceRequestedEventArgs e) { Log("ProtectionManager_ServiceRequested"); if (e.Request is PlayReadyIndividualizationServiceRequest) { Log("ProtectionManager_ServiceRequested: PlayReadyIndividualizationServiceRequest"); PlayReadyIndividualizationServiceRequest individualizationServiceRequest = (PlayReadyIndividualizationServiceRequest)e.Request; await individualizationServiceRequest.BeginServiceRequest(); Log("ProtectionManager_ServiceRequested: PlayReadyIndividualizationServiceRequest complete"); e.Completion.Complete(true); } else if (e.Request is PlayReadyLicenseAcquisitionServiceRequest) { Log("ProtectionManager_ServiceRequested: PlayReadyLicenseAcquisitionServiceRequest"); PlayReadyLicenseAcquisitionServiceRequest licenseAcquisitionRequest = (PlayReadyLicenseAcquisitionServiceRequest)e.Request; await licenseAcquisitionRequest.BeginServiceRequest(); Log("ProtectionManager_ServiceRequested: PlayReadyLicenseAcquisitionServiceRequest complete"); e.Completion.Complete(true); } }
void LegacyInstance_ChildServiceRequested(object sender, ServiceRequestedEventArgs e) { ChildServiceRequested(this, e); }