Översikt över Widevine-licensmallenWidevine license template overview
Du kan använda Azure Media Services för att konfigurera och begära Google Widevine-licenser.You can use Azure Media Services to configure and request Google Widevine licenses. När spelaren försöker spela upp det Widevine innehållet skickas en begäran till licens leverans tjänsten för att få en licens.When the player tries to play your Widevine-protected content, a request is sent to the license delivery service to obtain a license. Om licens tjänsten godkänner begäran utfärdar tjänsten licensen.If the license service approves the request, the service issues the license. Den skickas till klienten och används för att dekryptera och spela upp det angivna innehållet.It's sent to the client and is used to decrypt and play the specified content.
En begäran om Widevine-licens formateras som ett JSON-meddelande.A Widevine license request is formatted as a JSON message.
Anteckning
Du kan skapa ett tomt meddelande utan värden, bara " {} ."You can create an empty message with no values, just "{}." Sedan skapas en licens mal len med standardinställningar.Then a license template is created with defaults. Standard fungerar i de flesta fall.The default works for most cases. Microsoft-baserade licens leverans scenarier bör alltid använda standardvärdena.Microsoft-based license-delivery scenarios should always use the defaults. Om du behöver ställa in värdena "Provider" och "content_id" måste en provider matcha Widevine-autentiseringsuppgifter.If you need to set the "provider" and "content_id" values, a provider must match Widevine credentials.
{
"payload": "<license challenge>",
"content_id": "<content id>"
"provider": "<provider>"
"allowed_track_types": "<types>",
"content_key_specs": [
{
"track_type": "<track type 1>"
},
{
"track_type": "<track type 2>"
},
…
],
"policy_overrides": {
"can_play": <can play>,
"can persist": <can persist>,
"can_renew": <can renew>,
"rental_duration_seconds": <rental duration>,
"playback_duration_seconds": <playback duration>,
"license_duration_seconds": <license duration>,
"renewal_recovery_duration_seconds": <renewal recovery duration>,
"renewal_server_url": "<renewal server url>",
"renewal_delay_seconds": <renewal delay>,
"renewal_retry_interval_seconds": <renewal retry interval>,
"renew_with_usage": <renew with usage>
}
}
JSON-meddelandeJSON message
NameName | VärdeValue | BeskrivningDescription |
---|---|---|
payloadpayload | Base64-kodad strängBase64-encoded string | Den licens förfrågan som skickas av en klient.The license request sent by a client. |
content_idcontent_id | Base64-kodad strängBase64-encoded string | Identifierare som används för att härleda nyckel-ID och innehålls nyckel för varje content_key_specs. track_type.Identifier used to derive the key ID and content key for each content_key_specs.track_type. |
CSPprovider | strängstring | Används för att söka efter innehålls nycklar och principer.Used to look up content keys and policies. Om Microsoft Key Delivery används för Widevine License Delivery ignoreras den här parametern.If Microsoft key delivery is used for Widevine license delivery, this parameter is ignored. |
policy_namepolicy_name | strängstring | Namnet på en tidigare registrerad princip.Name of a previously registered policy. Valfritt.Optional. |
allowed_track_typesallowed_track_types | räkningenum | SD_ONLY eller SD_HD.SD_ONLY or SD_HD. Styr vilka innehålls nycklar som ingår i en licens.Controls which content keys are included in a license. |
content_key_specscontent_key_specs | Matrisen med JSON-strukturer finns i avsnittet "innehålls nyckel-specifikationer".Array of JSON structures, see the section "Content key specs." | En detaljerad kontroll som visar vilka innehålls nycklar som ska returneras.A finer-grained control on which content keys to return. Mer information finns i avsnittet "innehålls nyckel specifikationer".For more information, see the section "Content key specs." Det går bara att ange ett av värdena allowed_track_types och content_key_specs.Only one of the allowed_track_types and content_key_specs values can be specified. |
use_policy_overrides_exclusivelyuse_policy_overrides_exclusively | Booleskt värde, sant eller falsktBoolean, true or false | Använd de principmallar som anges av policy_overrides och utelämna alla tidigare lagrade principer.Use policy attributes specified by policy_overrides, and omit all previously stored policy. |
policy_overridespolicy_overrides | JSON-strukturen finns i avsnittet "princip åsidosättningar".JSON structure, see the section "Policy overrides." | Princip inställningar för den här licensen.Policy settings for this license. I händelse av att den här till gången har en fördefinierad princip används de angivna värdena.In the event this asset has a predefined policy, these specified values are used. |
session_initsession_init | JSON-strukturen finns i avsnittet "session-initiering".JSON structure, see the section "Session initialization." | Valfria data överförs till licensen.Optional data is passed to the license. |
parse_onlyparse_only | Booleskt värde, sant eller falsktBoolean, true or false | Begäran om licens tolkas, men ingen licens utfärdas.The license request is parsed, but no license is issued. Värden från licens förfrågan returneras dock i svaret.However, values from the license request are returned in the response. |
Specifikationer för innehålls nyckelContent key specs
Om det finns en befintlig princip behöver du inte ange något av värdena i innehålls nyckel specifikationen. Den befintliga principen som är associerad med det här innehållet används för att fastställa utmatnings skyddet, t. ex. digitala Content Protection med hög bandbredd (HDCP) och det kopierade hanterings systemet (CGMS).If a preexisting policy exists, there is no need to specify any of the values in the content key spec. The preexisting policy associated with this content is used to determine the output protection, such as High-bandwidth Digital Content Protection (HDCP) and the Copy General Management System (CGMS). Om en befintlig princip inte är registrerad på Widevine-licensserver, kan innehålls leverantören mata in värdena i licens förfrågan.If a preexisting policy isn't registered with the Widevine license server, the content provider can inject the values into the license request.
Varje content_key_specs värde måste anges för alla spår, oavsett alternativet use_policy_overrides_exclusively.Each content_key_specs value must be specified for all tracks, regardless of the use_policy_overrides_exclusively option.
NameName | VärdeValue | BeskrivningDescription |
---|---|---|
content_key_specs.content_key_specs. track_typetrack_type | strängstring | Ett namn på spår typ.A track type name. Om content_key_specs anges i licens förfrågan, se till att ange alla spår typer explicit.If content_key_specs is specified in the license request, make sure to specify all track types explicitly. Det gick inte att spela upp det senaste 10 sekunderna.Failure to do so results in failure to play back past 10 seconds. |
content_key_specscontent_key_specs security_levelsecurity_level |
UInt32uint32 | Definierar stabilitets kraven för klienten för uppspelning.Defines client robustness requirements for playback. -Programvarubaserad kryptografisk kryptering krävs.- Software-based white-box cryptography is required. – Program kryptering och en fördunklade-avkodare krävs.- Software cryptography and an obfuscated decoder are required. -Nyckel materialet och kryptografi åtgärderna måste utföras inom en maskinvarubaserad miljö med en maskin varu återställning.- The key material and cryptography operations must be performed within a hardware-backed trusted execution environment. -Kryptering och avkodning av innehåll måste utföras inom en maskinvarubaserad miljö med en maskin varu återställning.- The cryptography and decoding of content must be performed within a hardware-backed trusted execution environment. – Kryptering, avkodning och all hantering av mediet (komprimerade och okomprimerade) måste hanteras i en maskin varu hanterare som är en betrodd körnings miljö.- The cryptography, decoding, and all handling of the media (compressed and uncompressed) must be handled within a hardware-backed trusted execution environment. |
content_key_specscontent_key_specs required_output_protection. HDCrequired_output_protection.hdc |
sträng, en av HDCP_NONE HDCP_V1, HDCP_V2string, one of HDCP_NONE, HDCP_V1, HDCP_V2 | Anger om HDCP krävs.Indicates whether HDCP is required. |
content_key_specscontent_key_specs keykey |
Base64Base64- kodad strängencoded string |
Innehålls nyckel som ska användas för den här spårningen. Om det här alternativet anges måste track_type eller key_id.Content key to use for this track. If specified, the track_type or key_id is required. Innehålls leverantören kan använda det här alternativet för att mata in innehålls nyckeln för det här spåret i stället för att låta Widevine-licensservern generera eller slå upp en nyckel.The content provider can use this option to inject the content key for this track instead of letting the Widevine license server generate or look up a key. |
content_key_specs content_key_specs.key_idcontent_key_specs.key_id | Base64-kodad sträng binär, 16 byteBase64-encoded string binary, 16 bytes | Unik identifierare för nyckeln.Unique identifier for the key. |
Princip åsidosättningarPolicy overrides
NameName | VärdeValue | BeskrivningDescription |
---|---|---|
policy_overrides.policy_overrides. can_playcan_play | Booleskt värde, sant eller falsktBoolean, true or false | Anger att uppspelning av innehållet är tillåten.Indicates that playback of the content is allowed. Standardvärdet är false.Default is false. |
policy_overrides.policy_overrides. can_persistcan_persist | Booleskt värde, sant eller falsktBoolean, true or false | Anger att licensen kan vara bestående av Nonvolatile Storage för offline-användning.Indicates that the license might be persisted to nonvolatile storage for offline use. Standardvärdet är false.Default is false. |
policy_overrides.policy_overrides. can_renewcan_renew | Booleskt värde, sant eller falsktBoolean, true or false | Anger att förnyelse av den här licensen är tillåten.Indicates that renewal of this license is allowed. Om värdet är true kan licensens giltighets tid utökas med pulsslag.If true, the duration of the license can be extended by heartbeat. Standardvärdet är false.Default is false. |
policy_overrides.policy_overrides. license_duration_secondslicense_duration_seconds | Int64int64 | Anger tids perioden för den här speciella licensen.Indicates the time window for this specific license. Värdet 0 anger att det inte finns någon gräns för varaktigheten.A value of 0 indicates that there is no limit to the duration. Standardvärdet är 0.Default is 0. |
policy_overrides.policy_overrides. rental_duration_secondsrental_duration_seconds | Int64int64 | Anger tidsfönstret då uppspelning tillåts.Indicates the time window while playback is permitted. Värdet 0 anger att det inte finns någon gräns för varaktigheten.A value of 0 indicates that there is no limit to the duration. Standardvärdet är 0.Default is 0. |
policy_overrides.policy_overrides. playback_duration_secondsplayback_duration_seconds | Int64int64 | Visnings fönstret av tiden efter uppspelningen startar inom licensens varaktighet.The viewing window of time after playback starts within the license duration. Värdet 0 anger att det inte finns någon gräns för varaktigheten.A value of 0 indicates that there is no limit to the duration. Standardvärdet är 0.Default is 0. |
policy_overrides.policy_overrides. renewal_server_urlrenewal_server_url | strängstring | Alla pulsslags begär Anden (förnyelse) för den här licensen dirigeras till den angivna URL: en.All heartbeat (renewal) requests for this license are directed to the specified URL. Det här fältet används endast om can_renew är sant.This field is used only if can_renew is true. |
policy_overrides.policy_overrides. renewal_delay_secondsrenewal_delay_seconds | Int64int64 | Hur många sekunder efter license_start_time innan förnyelsen försöktes första gången.How many seconds after license_start_time before renewal is first attempted. Det här fältet används endast om can_renew är sant.This field is used only if can_renew is true. Standardvärdet är 0.Default is 0. |
policy_overrides.policy_overrides. renewal_retry_interval_secondsrenewal_retry_interval_seconds | Int64int64 | Anger fördröjningen i sekunder mellan efterföljande begär Anden om licens förnyelse, i händelse av ett haveri.Specifies the delay in seconds between subsequent license renewal requests, in case of failure. Det här fältet används endast om can_renew är sant.This field is used only if can_renew is true. |
policy_overrides.policy_overrides. renewal_recovery_duration_secondsrenewal_recovery_duration_seconds | Int64int64 | Tids period då uppspelningen kan fortsätta medan förnyelsen görs, men som inte lyckas på grund av backend-problem med licens servern.The window of time in which playback can continue while renewal is attempted, yet unsuccessful due to back-end problems with the license server. Värdet 0 anger att det inte finns någon gräns för varaktigheten.A value of 0 indicates that there is no limit to the duration. Det här fältet används endast om can_renew är sant.This field is used only if can_renew is true. |
policy_overrides.policy_overrides. renew_with_usagerenew_with_usage | Booleskt värde, sant eller falsktBoolean, true or false | Anger att licensen har skickats för förnyelse när användningen startar.Indicates that the license is sent for renewal when usage starts. Det här fältet används endast om can_renew är sant.This field is used only if can_renew is true. |
Initiering av sessionSession initialization
NameName | VärdeValue | BeskrivningDescription |
---|---|---|
provider_session_tokenprovider_session_token | Base64-kodad strängBase64-encoded string | Denna sessionstoken skickas tillbaka i licensen och finns i efterföljande förnyelser.This session token is passed back in the license and exists in subsequent renewals. Sessionstoken kvarstår utanför sessioner.The session token doesn't persist beyond sessions. |
provider_client_tokenprovider_client_token | Base64-kodad strängBase64-encoded string | Klient-token att skicka tillbaka i licens svaret.Client token to send back in the license response. Om licens förfrågan innehåller en klient-token ignoreras värdet.If the license request contains a client token, this value is ignored. Klientens token kvarstår utanför licens-sessioner.The client token persists beyond license sessions. |
override_provider_client_tokenoverride_provider_client_token | Booleskt värde, sant eller falsktBoolean, true or false | Om värdet är false och licens förfrågan innehåller en klient-token använder du token från begäran även om en klient-token har angetts i den här strukturen.If false and the license request contains a client token, use the token from the request even if a client token was specified in this structure. Om värdet är true, ska du alltid använda den token som anges i den här strukturen.If true, always use the token specified in this structure. |
Konfigurera dina Widevine-licenser med hjälp av .NET-typerConfigure your Widevine licenses by using .NET types
Media Services tillhandahåller .NET-API: er som du kan använda för att konfigurera dina Widevine-licenser.Media Services provides .NET APIs that you can use to configure your Widevine licenses.
Klasser som definieras i Media Services .NET SDKClasses as defined in the Media Services .NET SDK
Följande klasser är definitioner av dessa typer:The following classes are the definitions of these types:
public class WidevineMessage
{
public WidevineMessage();
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public AllowedTrackTypes? allowed_track_types { get; set; }
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public ContentKeySpecs[] content_key_specs { get; set; }
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public object policy_overrides { get; set; }
}
[JsonConverter(typeof(StringEnumConverter))]
public enum AllowedTrackTypes
{
SD_ONLY = 0,
SD_HD = 1
}
public class ContentKeySpecs
{
public ContentKeySpecs();
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string key_id { get; set; }
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public RequiredOutputProtection required_output_protection { get; set; }
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public int? security_level { get; set; }
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string track_type { get; set; }
}
public class RequiredOutputProtection
{
public RequiredOutputProtection();
public Hdcp hdcp { get; set; }
}
[JsonConverter(typeof(StringEnumConverter))]
public enum Hdcp
{
HDCP_NONE = 0,
HDCP_V1 = 1,
HDCP_V2 = 2
}
ExempelExample
I följande exempel visas hur du använder .NET-API: er för att konfigurera en enkel Widevine-licens:The following example shows how to use .NET APIs to configure a simple Widevine license:
private static string ConfigureWidevineLicenseTemplate()
{
var template = new WidevineMessage
{
allowed_track_types = AllowedTrackTypes.SD_HD,
content_key_specs = new[]
{
new ContentKeySpecs
{
required_output_protection = new RequiredOutputProtection { hdcp = Hdcp.HDCP_NONE},
security_level = 1,
track_type = "SD"
}
},
policy_overrides = new
{
can_play = true,
can_persist = true,
can_renew = false
}
};
string configuration = JsonConvert.SerializeObject(template);
return configuration;
}
Ytterligare informationAdditional notes
- Widevine är en tjänst som tillhandahålls av Google Inc. och omfattas av villkoren i tjänste-och sekretess policyn för Google, Inc.Widevine is a service provided by Google Inc. and subject to the terms of service and Privacy Policy of Google, Inc.
Sökvägar för Media Services-utbildningMedia Services learning paths
Media Services v3 (senaste)Media Services v3 (latest)
Kolla in den senaste versionen av Azure Media Services!Check out the latest version of Azure Media Services!
- ÖversiktOverview
- BegreppConcepts
- Börja utvecklaStart developing
- Vägledning för migrering från v2 till v3Migration guidance from v2 to v3
Media Services v2 (äldre)Media Services v2 (legacy)
- ÖversiktOverview
- Skapa kontoCreate account
- Leverera på begäranDeliver on-demand
- Leverera LiveDeliver live
Ge feedbackProvide feedback
Använd User Voice-forumet för att ge feedback och förslag på hur Azure Media Services kan förbättras.Use the User Voice forum to provide feedback and make suggestions on how to improve Azure Media Services. Du kan även gå direkt till någon av följande kategorier:You also can go directly to one of the following categories:
- Azure Media PlayerAzure Media Player
- SDK-klientbibliotekClient SDK libraries
- Kodning och bearbetningEncoding and processing
- LiveuppspelningLive streaming
- MedieanalysMedia Analytics
- Azure-portalenAzure portal
- REST-API och plattformREST API and platform
- Videoströmning på begäranVideo-on-demand streaming