示例#1
0
        /// <summary>
        /// The helper class will determine the exact type of ServiceRequest in order to customize and send
        /// the service request. ServiceRequests (except for Individualization and Revocation) also support the
        /// GenerateManualEnablingChallenge method. This can be used to read and customize the SOAP challenge
        /// and manually send the challenge.
        /// </summary>
        void ProcessServiceRequest(IMediaProtectionServiceRequest serviceRequest)
        {
            //Alternatively the serviceRequest can be determined by the Guid serviceRequest.Type
            if (serviceRequest is PlayReadyIndividualizationServiceRequest)
            {
                PlayReadyHelpers.ReactiveIndividualization(serviceRequest as PlayReadyIndividualizationServiceRequest, serviceCompletionNotifier, () => PlayReadyInfo.RefreshStatics());
                PlayReadyInfo.RefreshStatics();
            }
            else if (serviceRequest is PlayReadyLicenseAcquisitionServiceRequest)
            {
                var licenseRequest = serviceRequest as PlayReadyLicenseAcquisitionServiceRequest;
                // The inital service request url was taken from the playready header from the dash manifest.
                // This can overridden to a different license service prior to sending the request (staging, production,...).
                licenseRequest.Uri = new Uri(licenseURL);

                PlayReadyHelpers.ReactiveLicenseAcquisition(licenseRequest, serviceCompletionNotifier);
                SetPlaybackEnabled(true);
            }

            // Here are the additional service calls available to support other scenarios
            //PlayReadySecureStopServiceRequest
            //PlayReadyDomainJoinServiceRequest
            //PlayReadyDomainLeaveServiceRequest
            //PlayReadyMeteringReportServiceRequest

            //PlayReadyRevocationServiceRequest
        }
 void ProcessServiceRequest(IMediaProtectionServiceRequest serviceRequest)
 {
     //Alternatively the serviceRequest can be determined by the Guid serviceRequest.Type
     if (serviceRequest is PlayReadyIndividualizationServiceRequest)
     {
         PlayReadyHelpers.ReactiveIndividualization(serviceRequest as PlayReadyIndividualizationServiceRequest, serviceCompletionNotifier, () => PlayReadyInfo.RefreshStatics());
         PlayReadyInfo.RefreshStatics();
     }
     else if (serviceRequest is PlayReadyLicenseAcquisitionServiceRequest)
     {
         PlayReadyHelpers.ReactiveLicenseAcquisition(serviceRequest as PlayReadyLicenseAcquisitionServiceRequest, serviceCompletionNotifier);
     }
 }
        /// <summary>
        /// The helper class will determine the exact type of ServiceRequest in order to customize and send
        /// the service request. ServiceRequests (except for Individualization and Revocation) also support the
        /// GenerateManualEnablingChallenge method. This can be used to read and customize the SOAP challenge
        /// and manually send the challenge.
        /// </summary>
        void ProcessServiceRequest(IMediaProtectionServiceRequest serviceRequest)
        {
            //Alternatively the serviceRequest can be determined by the Guid serviceRequest.Type
            if (serviceRequest is PlayReadyIndividualizationServiceRequest)
            {
                PlayReadyHelpers.ReactiveIndividualization(serviceRequest as PlayReadyIndividualizationServiceRequest, serviceCompletionNotifier, () => PlayReadyInfo.RefreshStatics());
                PlayReadyInfo.RefreshStatics();
            }
            else if (serviceRequest is PlayReadyLicenseAcquisitionServiceRequest)
            {
                var licenseRequest = serviceRequest as PlayReadyLicenseAcquisitionServiceRequest;
                // The initial service request url was taken from the playready header from the dash manifest.
                // This can overridden to a different license service prior to sending the request (staging, production,...).
                licenseRequest.Uri = new Uri(licenseUrl);

                PlayReadyHelpers.ReactiveLicenseAcquisition(licenseRequest, serviceCompletionNotifier);
            }
        }
示例#4
0
        /// <summary>
        /// ...
        /// </summary>
        void ProcessServiceRequest(IMediaProtectionServiceRequest serviceRequest)
        {
            //Alternatively the serviceRequest can be determined by the Guid serviceRequest.Type
            if (serviceRequest is PlayReadyIndividualizationServiceRequest)
            {
                PlayReadyHelpers.ReactiveIndividualization(serviceRequest as PlayReadyIndividualizationServiceRequest, serviceCompletionNotifier, () => PlayReadyInfo.RefreshStatics());
                PlayReadyInfo.RefreshStatics();
            }
            else if (serviceRequest is PlayReadyLicenseAcquisitionServiceRequest)
            {
                var licenseServiceRequestNotUsed = (serviceRequest as PlayReadyLicenseAcquisitionServiceRequest);
                activePlayReadyHeader = licenseServiceRequestNotUsed.ContentHeader;

                var licenseServiceRequest = licenseSession.CreateLAServiceRequest();
                licenseServiceRequest.ContentHeader = activePlayReadyHeader;
                licenseServiceRequest.Uri           = new Uri(licenseUrl);
                PlayReadyHelpers.ReactiveLicenseAcquisition(licenseServiceRequest, serviceCompletionNotifier);
            }
        }
示例#5
0
        /// <summary>
        /// The helper class will determine the exact type of ServiceRequest in order to customize and send
        /// the service request. ServiceRequests (except for Individualization and Revocation) also support the
        /// GenerateManualEnablingChallenge method. This can be used to read and customize the SOAP challenge
        /// and manually send the challenge.
        /// </summary>
        async Task ProcessServiceRequest(IMediaProtectionServiceRequest serviceRequest)
        {
            //Alternatively the serviceRequest can be determined by the Guid serviceRequest.Type
            if (serviceRequest is PlayReadyIndividualizationServiceRequest)
            {
                PlayReadyHelpers.ReactiveIndividualization(serviceRequest as PlayReadyIndividualizationServiceRequest, serviceCompletionNotifier, () => RefreshPlayreadyStats());
                RefreshPlayreadyStats();
            }
            else if (serviceRequest is PlayReadyLicenseAcquisitionServiceRequest)
            {
                var licenseRequest = serviceRequest as PlayReadyLicenseAcquisitionServiceRequest;
                // The initial service request url was taken from the playready header from the dash manifest.
                // This can overridden to a different license service prior to sending the request (staging, production,...).

                if (!String.IsNullOrWhiteSpace(_licenseOverride))
                {
                    licenseRequest.Uri = new Uri(_licenseOverride);
                }

                PlayReadyHelpers.ReactiveLicenseAcquisition(licenseRequest, serviceCompletionNotifier);
            }
        }
 void ProcessServiceRequest(IMediaProtectionServiceRequest serviceRequest)
 {
     //Alternatively the serviceRequest can be determined by the Guid serviceRequest.Type
     if (serviceRequest is PlayReadyIndividualizationServiceRequest)
     {
        PlayReadyHelpers.ReactiveIndividualization(serviceRequest as PlayReadyIndividualizationServiceRequest, serviceCompletionNotifier, () => PlayReadyInfo.RefreshStatics());
        PlayReadyInfo.RefreshStatics();
     }
     else if (serviceRequest is PlayReadyLicenseAcquisitionServiceRequest)
     {
         PlayReadyHelpers.ReactiveLicenseAcquisition(serviceRequest as PlayReadyLicenseAcquisitionServiceRequest,  serviceCompletionNotifier);
     }
 }
        /// <summary>
        /// The helper class will determine the exact type of ServiceRequest in order to customize and send
        /// the service request. ServiceRequests (except for Individualization and Revocation) also support the
        /// GenerateManualEnablingChallenge method. This can be used to read and customize the SOAP challenge
        /// and manually send the challenge.
        /// </summary>
        void ProcessServiceRequest(IMediaProtectionServiceRequest serviceRequest)
        {
            //Alternatively the serviceRequest can be determined by the Guid serviceRequest.Type
            if (serviceRequest is PlayReadyIndividualizationServiceRequest)
            {
               PlayReadyHelpers.ReactiveIndividualization(serviceRequest as PlayReadyIndividualizationServiceRequest, serviceCompletionNotifier, () => PlayReadyInfo.RefreshStatics());
               PlayReadyInfo.RefreshStatics();
            }
            else if (serviceRequest is PlayReadyLicenseAcquisitionServiceRequest)
            {
                var licenseRequest = serviceRequest as PlayReadyLicenseAcquisitionServiceRequest;
                // The inital service request url was taken from the playready header from the dash manifest.
                // This can overridden to a different license service prior to sending the request (staging, production,...). 
                licenseRequest.Uri = new Uri(licenseURL);

                PlayReadyHelpers.ReactiveLicenseAcquisition(licenseRequest,  serviceCompletionNotifier);
                SetPlaybackEnabled(true);
            }

            // Here are the additional service calls available to support other scenarios
            //PlayReadySecureStopServiceRequest
            //PlayReadyDomainJoinServiceRequest
            //PlayReadyDomainLeaveServiceRequest
            //PlayReadyMeteringReportServiceRequest

            //PlayReadyRevocationServiceRequest

        }
        /// <summary>
        /// The helper class will determine the exact type of ServiceRequest in order to customize and send
        /// the service request. ServiceRequests (except for Individualization and Revocation) also support the
        /// GenerateManualEnablingChallenge method. This can be used to read and customize the SOAP challenge
        /// and manually send the challenge.
        /// </summary>
        void ProcessServiceRequest(IMediaProtectionServiceRequest serviceRequest)
        {
            //Alternatively the serviceRequest can be determined by the Guid serviceRequest.Type
            if (serviceRequest is PlayReadyIndividualizationServiceRequest)
            {
                PlayReadyHelpers.ReactiveIndividualization(serviceRequest as PlayReadyIndividualizationServiceRequest, serviceCompletionNotifier, () => PlayReadyInfo.RefreshStatics());
                PlayReadyInfo.RefreshStatics();
            }
            else if (serviceRequest is PlayReadyLicenseAcquisitionServiceRequest)
            {
                var licenseRequest = serviceRequest as PlayReadyLicenseAcquisitionServiceRequest;
                // The initial service request url was taken from the playready header from the dash manifest.
                // This can overridden to a different license service prior to sending the request (staging, production,...). 
                licenseRequest.Uri = new Uri(licenseUrl);

                PlayReadyHelpers.ReactiveLicenseAcquisition(licenseRequest, serviceCompletionNotifier);
            }

        }
        /// <summary>
        /// ...
        /// </summary>
        void ProcessServiceRequest(IMediaProtectionServiceRequest serviceRequest)
        {
            //Alternatively the serviceRequest can be determined by the Guid serviceRequest.Type
            if (serviceRequest is PlayReadyIndividualizationServiceRequest)
            {
                PlayReadyHelpers.ReactiveIndividualization(serviceRequest as PlayReadyIndividualizationServiceRequest, serviceCompletionNotifier, () => PlayReadyInfo.RefreshStatics());
                PlayReadyInfo.RefreshStatics();
            }
            else if (serviceRequest is PlayReadyLicenseAcquisitionServiceRequest)
            {
                var licenseServiceRequestNotUsed = (serviceRequest as PlayReadyLicenseAcquisitionServiceRequest);
                activePlayReadyHeader = licenseServiceRequestNotUsed.ContentHeader;

                var licenseServiceRequest = licenseSession.CreateLAServiceRequest();
                licenseServiceRequest.ContentHeader = activePlayReadyHeader;
                licenseServiceRequest.Uri = new Uri(licenseUrl);
                PlayReadyHelpers.ReactiveLicenseAcquisition(licenseServiceRequest, serviceCompletionNotifier);
            }
        }