/// <summary>
        /// Configures Widevine license template.
        /// </summary>
        /// <returns></returns>
        private static ContentKeyPolicyWidevineConfiguration ConfigureWidevineLicenseTempate()
        {
            WidevineTemplate template = new WidevineTemplate()
            {
                AllowedTrackTypes = "SD_HD",
                ContentKeySpecs   = new ContentKeySpec[]
                {
                    new ContentKeySpec()
                    {
                        TrackType                = "SD",
                        SecurityLevel            = 1,
                        RequiredOutputProtection = new OutputProtection()
                        {
                            HDCP = "HDCP_NONE"
                        }
                    }
                },
                PolicyOverrides = new PolicyOverrides()
                {
                    CanPlay                 = true,
                    CanPersist              = false,
                    CanRenew                = false,
                    RentalDurationSeconds   = 2592000,
                    PlaybackDurationSeconds = 10800,
                    LicenseDurationSeconds  = 604800,
                }
            };

            ContentKeyPolicyWidevineConfiguration objContentKeyPolicyWidevineConfiguration = new ContentKeyPolicyWidevineConfiguration
            {
                WidevineTemplate = Newtonsoft.Json.JsonConvert.SerializeObject(template)
            };

            return(objContentKeyPolicyWidevineConfiguration);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Configures Widevine license template.
        /// </summary>
        /// <returns></returns>
        private static ContentKeyPolicyWidevineConfiguration ConfigureWidevineLicenseTempate()
        {
            WidevineTemplate template = new WidevineTemplate()
            {
                AllowedTrackTypes = "SD_HD",
                ContentKeySpecs   = new ContentKeySpec[]
                {
                    new ContentKeySpec()
                    {
                        TrackType                = "SD",
                        SecurityLevel            = 1,
                        RequiredOutputProtection = new OutputProtection()
                        {
                            HDCP = "HDCP_NONE"
                                   // NOTE: the policy should be set to "HDCP_V1" (or greater) if you need to disable screen capture. The Widevine desktop
                                   // browser CDM module only blocks screen capture when HDCP is enabled and the screen capture application is using
                                   // Chromes screen capture APIs.
                        }
                    }
                },
                PolicyOverrides = new PolicyOverrides()
                {
                    CanPlay                 = true,
                    CanPersist              = false,
                    CanRenew                = false,
                    RentalDurationSeconds   = 2592000,
                    PlaybackDurationSeconds = 10800,
                    LicenseDurationSeconds  = 604800,
                }
            };

            ContentKeyPolicyWidevineConfiguration objContentKeyPolicyWidevineConfiguration = new ContentKeyPolicyWidevineConfiguration
            {
                WidevineTemplate = Newtonsoft.Json.JsonConvert.SerializeObject(template)
            };

            return(objContentKeyPolicyWidevineConfiguration);
        }