Streaming Policies - Create
Skapa en direktuppspelningsprincip i Media Services konto
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingPolicies/{streamingPolicyName}?api-version=2020-05-01
URI-parametrar
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
account
|
path | True |
|
Namnet Media Services konto. |
|
resource
|
path | True |
|
Namnet på resursgruppen i Azure-prenumerationen. |
|
streaming
|
path | True |
|
Namnet på strömningsprincipen. |
|
subscription
|
path | True |
|
Unik identifierare för en Microsoft Azure prenumeration. |
|
api-version
|
query | True |
|
Den version av API:et som ska användas med klientbegäran. |
Begärandetext
| Name | Type | Description |
|---|---|---|
| properties.commonEncryptionCbcs |
Konfiguration av CommonEncryptionCbcs |
|
| properties.commonEncryptionCenc |
Konfiguration av CommonEncryptionCenc |
|
| properties.defaultContentKeyPolicyName |
|
Standardinnehållsnyckel som används av den aktuella strömningsprincipen |
| properties.envelopeEncryption |
Konfiguration av EnvelopeEncryption |
|
| properties.noEncryption |
Konfigurationer av NoEncryption |
Svar
| Name | Type | Description |
|---|---|---|
| 201 Created |
Skapad |
|
| Other Status Codes |
Detaljerad felinformation. |
Exempel
Creates a Streaming Policy with clear streaming
Sample Request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaServices/contosomedia/streamingPolicies/UserCreatedClearStreamingPolicy?api-version=2020-05-01
{
"properties": {
"noEncryption": {
"enabledProtocols": {
"download": true,
"dash": true,
"hls": true,
"smoothStreaming": true
}
}
}
}
Sample Response
{
"name": "UserCreatedClearStreamingPolicy",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaservices/contosomedia/streamingPolicies/UserCreatedClearStreamingPolicy",
"type": "Microsoft.Media/mediaservices/streamingPolicies",
"properties": {
"created": "2018-08-08T18:29:31.1535417Z",
"noEncryption": {
"enabledProtocols": {
"download": true,
"dash": true,
"hls": true,
"smoothStreaming": true
}
}
}
}
Creates a Streaming Policy with commonEncryptionCbcs only
Sample Request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaServices/contosomedia/streamingPolicies/UserCreatedSecureStreamingPolicyWithCommonEncryptionCbcsOnly?api-version=2020-05-01
{
"properties": {
"defaultContentKeyPolicyName": "PolicyWithMultipleOptions",
"commonEncryptionCbcs": {
"enabledProtocols": {
"download": false,
"dash": false,
"hls": true,
"smoothStreaming": false
},
"contentKeys": {
"defaultKey": {
"label": "cbcsDefaultKey"
}
},
"drm": {
"fairPlay": {
"customLicenseAcquisitionUrlTemplate": "https://contoso.com/{AssetAlternativeId}/fairplay/{ContentKeyId}",
"allowPersistentLicense": true
}
}
}
}
}
Sample Response
{
"name": "UserCreatedSecureStreamingPolicyWithCommonEncryptionCbcsOnly",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaservices/contosomedia/streamingPolicies/UserCreatedSecureStreamingPolicyWithCommonEncryptionCbcsOnly",
"type": "Microsoft.Media/mediaservices/streamingPolicies",
"properties": {
"created": "2018-08-08T18:29:31.6197199Z",
"defaultContentKeyPolicyName": "PolicyWithMultipleOptions",
"commonEncryptionCbcs": {
"enabledProtocols": {
"download": false,
"dash": false,
"hls": true,
"smoothStreaming": false
},
"clearTracks": [],
"contentKeys": {
"defaultKey": {
"label": "cbcsDefaultKey"
},
"keyToTrackMappings": []
},
"drm": {
"fairPlay": {
"customLicenseAcquisitionUrlTemplate": "https://contoso.com/{AssetAlternativeId}/fairplay/{ContentKeyId}",
"allowPersistentLicense": true
}
}
}
}
}
Creates a Streaming Policy with commonEncryptionCenc only
Sample Request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaServices/contosomedia/streamingPolicies/UserCreatedSecureStreamingPolicyWithCommonEncryptionCencOnly?api-version=2020-05-01
{
"properties": {
"defaultContentKeyPolicyName": "PolicyWithPlayReadyOptionAndOpenRestriction",
"commonEncryptionCenc": {
"enabledProtocols": {
"download": false,
"dash": true,
"hls": false,
"smoothStreaming": true
},
"clearTracks": [
{
"trackSelections": [
{
"property": "FourCC",
"operation": "Equal",
"value": "hev1"
}
]
}
],
"contentKeys": {
"defaultKey": {
"label": "cencDefaultKey"
}
},
"drm": {
"playReady": {
"customLicenseAcquisitionUrlTemplate": "https://contoso.com/{AssetAlternativeId}/playready/{ContentKeyId}",
"playReadyCustomAttributes": "PlayReady CustomAttributes"
},
"widevine": {
"customLicenseAcquisitionUrlTemplate": "https://contoso.com/{AssetAlternativeId}/widevine/{ContentKeyId"
}
}
}
}
}
Sample Response
{
"name": "UserCreatedSecureStreamingPolicyWithCommonEncryptionCencOnly",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaservices/contosomedia/streamingPolicies/UserCreatedSecureStreamingPolicyWithCommonEncryptionCencOnly",
"type": "Microsoft.Media/mediaservices/streamingPolicies",
"properties": {
"created": "2018-08-08T18:29:31.4678543Z",
"defaultContentKeyPolicyName": "PolicyWithPlayReadyOptionAndOpenRestriction",
"commonEncryptionCenc": {
"enabledProtocols": {
"download": false,
"dash": true,
"hls": false,
"smoothStreaming": true
},
"clearTracks": [
{
"trackSelections": [
{
"property": "FourCC",
"operation": "Equal",
"value": "hev1"
}
]
}
],
"contentKeys": {
"defaultKey": {
"label": "cencDefaultKey"
},
"keyToTrackMappings": []
},
"drm": {
"playReady": {
"customLicenseAcquisitionUrlTemplate": "https://contoso.com/{AssetAlternativeId}/playready/{ContentKeyId}",
"playReadyCustomAttributes": "PlayReady CustomAttributes"
},
"widevine": {
"customLicenseAcquisitionUrlTemplate": "https://contoso.com/{AssetAlternativeId}/widevine/{ContentKeyId"
}
}
}
}
}
Creates a Streaming Policy with envelopeEncryption only
Sample Request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaServices/contosomedia/streamingPolicies/UserCreatedSecureStreamingPolicyWithEnvelopeEncryptionOnly?api-version=2020-05-01
{
"properties": {
"defaultContentKeyPolicyName": "PolicyWithClearKeyOptionAndTokenRestriction",
"envelopeEncryption": {
"enabledProtocols": {
"download": false,
"dash": true,
"hls": true,
"smoothStreaming": true
},
"contentKeys": {
"defaultKey": {
"label": "aesDefaultKey"
}
},
"customKeyAcquisitionUrlTemplate": "https://contoso.com/{AssetAlternativeId}/envelope/{ContentKeyId}"
}
}
}
Sample Response
{
"name": "UserCreatedSecureStreamingPolicyWithEnvelopeEncryptionOnly",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaservices/contosomedia/streamingPolicies/UserCreatedSecureStreamingPolicyWithEnvelopeEncryptionOnly",
"type": "Microsoft.Media/mediaservices/streamingPolicies",
"properties": {
"created": "2018-08-08T18:29:31.3055712Z",
"defaultContentKeyPolicyName": "PolicyWithClearKeyOptionAndTokenRestriction",
"envelopeEncryption": {
"enabledProtocols": {
"download": false,
"dash": true,
"hls": true,
"smoothStreaming": true
},
"clearTracks": [],
"contentKeys": {
"defaultKey": {
"label": "aesDefaultKey"
},
"keyToTrackMappings": []
},
"customKeyAcquisitionUrlTemplate": "https://contoso.com/{AssetAlternativeId}/envelope/{ContentKeyId}"
}
}
}
Creates a Streaming Policy with secure streaming
Sample Request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaServices/contosomedia/streamingPolicies/UserCreatedSecureStreamingPolicy?api-version=2020-05-01
{
"properties": {
"defaultContentKeyPolicyName": "PolicyWithMultipleOptions",
"envelopeEncryption": {
"enabledProtocols": {
"download": false,
"dash": true,
"hls": true,
"smoothStreaming": true
},
"contentKeys": {
"defaultKey": {
"label": "aesDefaultKey"
}
},
"customKeyAcquisitionUrlTemplate": "https://contoso.com/{AssetAlternativeId}/envelope/{ContentKeyId}"
},
"commonEncryptionCenc": {
"enabledProtocols": {
"download": false,
"dash": true,
"hls": false,
"smoothStreaming": true
},
"clearTracks": [
{
"trackSelections": [
{
"property": "FourCC",
"operation": "Equal",
"value": "hev1"
}
]
}
],
"contentKeys": {
"defaultKey": {
"label": "cencDefaultKey"
}
},
"drm": {
"playReady": {
"customLicenseAcquisitionUrlTemplate": "https://contoso.com/{AssetAlternativeId}/playready/{ContentKeyId}",
"playReadyCustomAttributes": "PlayReady CustomAttributes"
},
"widevine": {
"customLicenseAcquisitionUrlTemplate": "https://contoso.com/{AssetAlternativeId}/widevine/{ContentKeyId"
}
}
},
"commonEncryptionCbcs": {
"enabledProtocols": {
"download": false,
"dash": false,
"hls": true,
"smoothStreaming": false
},
"contentKeys": {
"defaultKey": {
"label": "cbcsDefaultKey"
}
},
"drm": {
"fairPlay": {
"customLicenseAcquisitionUrlTemplate": "https://contoso.com/{AssetAlternativeId}/fairplay/{ContentKeyId}",
"allowPersistentLicense": true
}
}
}
}
}
Sample Response
{
"name": "UserCreatedSecureStreamingPolicy",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaservices/contosomedia/streamingPolicies/UserCreatedSecureStreamingPolicy",
"type": "Microsoft.Media/mediaservices/streamingPolicies",
"properties": {
"created": "2018-08-08T18:29:31.7715696Z",
"defaultContentKeyPolicyName": "PolicyWithMultipleOptions",
"envelopeEncryption": {
"enabledProtocols": {
"download": false,
"dash": true,
"hls": true,
"smoothStreaming": true
},
"clearTracks": [],
"contentKeys": {
"defaultKey": {
"label": "aesDefaultKey"
},
"keyToTrackMappings": []
},
"customKeyAcquisitionUrlTemplate": "https://contoso.com/{AssetAlternativeId}/envelope/{ContentKeyId}"
},
"commonEncryptionCenc": {
"enabledProtocols": {
"download": false,
"dash": true,
"hls": false,
"smoothStreaming": true
},
"clearTracks": [
{
"trackSelections": [
{
"property": "FourCC",
"operation": "Equal",
"value": "hev1"
}
]
}
],
"contentKeys": {
"defaultKey": {
"label": "cencDefaultKey"
},
"keyToTrackMappings": []
},
"drm": {
"playReady": {
"customLicenseAcquisitionUrlTemplate": "https://contoso.com/{AssetAlternativeId}/playready/{ContentKeyId}",
"playReadyCustomAttributes": "PlayReady CustomAttributes"
},
"widevine": {
"customLicenseAcquisitionUrlTemplate": "https://contoso.com/{AssetAlternativeId}/widevine/{ContentKeyId"
}
}
},
"commonEncryptionCbcs": {
"enabledProtocols": {
"download": false,
"dash": false,
"hls": true,
"smoothStreaming": false
},
"clearTracks": [],
"contentKeys": {
"defaultKey": {
"label": "cbcsDefaultKey"
},
"keyToTrackMappings": []
},
"drm": {
"fairPlay": {
"customLicenseAcquisitionUrlTemplate": "https://contoso.com/{AssetAlternativeId}/fairplay/{ContentKeyId}",
"allowPersistentLicense": true
}
}
}
}
}
Definitioner
|
Api |
API-felet. |
|
Cbcs |
Klass för att ange DRM-konfigurationer av CommonEncryptionCbcs-schemat i strömningsprincip |
|
Cenc |
Klass för att ange DRM-konfigurationer för CommonEncryptionCenc-schemat i strömningsprincip |
|
Common |
Klass för CommonEncryptionCbcs-krypteringsschema |
|
Common |
Klass för kuvertkrypteringsschema |
|
created |
Den typ av identitet som skapade resursen. |
|
Default |
Klass för att ange egenskaper för standardinnehållsnyckeln för varje krypteringsschema |
|
Enabled |
Klass för att ange vilka protokoll som är aktiverade |
|
Envelope |
Klass för kryptografischemat EnvelopeEncryption |
|
No |
Klass för NoEncryption-schema |
|
OData |
Information om ett fel. |
|
Streaming |
En resurs för direktuppspelningsprincip |
|
Streaming |
Klass för att ange egenskaper för innehållsnyckeln |
|
Streaming |
Klass för att ange egenskaper för alla innehållsnycklar i strömningsprincip |
|
Streaming |
Klass för att ange konfigurationer av FairPlay i direktuppspelningsprincip |
|
Streaming |
Klass för att ange konfigurationer av PlayReady i strömningsprincip |
|
Streaming |
Klass för att ange konfigurationer av Widevine i strömningsprincip |
|
system |
Metadata som rör skapande och senaste ändring av resursen. |
|
Track |
Spåra åtgärd för egenskapsvillkor |
|
Track |
Klass för att ange ett villkor för spåregenskap |
|
Track |
Spåra egenskapstyp |
|
Track |
Klass för att välja ett spår |
ApiError
API-felet.
| Name | Type | Description |
|---|---|---|
| error |
Felegenskaperna. |
CbcsDrmConfiguration
Klass för att ange DRM-konfigurationer av CommonEncryptionCbcs-schemat i strömningsprincip
| Name | Type | Description |
|---|---|---|
| fairPlay |
FairPlay-konfigurationer |
|
| playReady |
PlayReady-konfigurationer |
|
| widevine |
Widevine-konfigurationer |
CencDrmConfiguration
Klass för att ange DRM-konfigurationer för CommonEncryptionCenc-schemat i strömningsprincip
| Name | Type | Description |
|---|---|---|
| playReady |
PlayReady-konfigurationer |
|
| widevine |
Widevine-konfigurationer |
CommonEncryptionCbcs
Klass för CommonEncryptionCbcs-krypteringsschema
| Name | Type | Description |
|---|---|---|
| clearTracks |
Representerar vilka spår som inte ska krypteras |
|
| contentKeys |
Representerar standardinnehållsnyckeln för varje krypteringsschema och separata innehållsnycklar för specifika spår |
|
| drm |
Konfiguration av DRM:er för aktuellt krypteringsschema |
|
| enabledProtocols |
Representerar protokoll som stöds |
CommonEncryptionCenc
Klass för kuvertkrypteringsschema
| Name | Type | Description |
|---|---|---|
| clearTracks |
Representerar vilka spår som inte ska krypteras |
|
| contentKeys |
Representerar standardinnehållsnyckeln för varje krypteringsschema och separata innehållsnycklar för specifika spår |
|
| drm |
Konfiguration av DRM:er för CommonEncryptionCenc-krypteringsschema |
|
| enabledProtocols |
Representerar protokoll som stöds |
createdByType
Den typ av identitet som skapade resursen.
| Name | Type | Description |
|---|---|---|
| Application |
|
|
| Key |
|
|
| ManagedIdentity |
|
|
| User |
|
DefaultKey
Klass för att ange egenskaper för standardinnehållsnyckeln för varje krypteringsschema
| Name | Type | Description |
|---|---|---|
| label |
|
Etikett kan användas för att ange innehållsnyckel när du skapar en positionerare för direktuppspelning |
| policyName |
|
Princip som används av standardnyckeln |
EnabledProtocols
Klass för att ange vilka protokoll som är aktiverade
| Name | Type | Description |
|---|---|---|
| dash |
|
Aktivera DASH-protokollet eller inte |
| download |
|
Aktivera hämtningsprotokoll eller inte |
| hls |
|
Aktivera HLS-protokollet eller inte |
| smoothStreaming |
|
Aktivera SmoothStreaming-protokollet eller inte |
EnvelopeEncryption
Klass för kryptografischemat EnvelopeEncryption
| Name | Type | Description |
|---|---|---|
| clearTracks |
Representerar vilka spår som inte ska krypteras |
|
| contentKeys |
Representerar standardinnehållsnyckeln för varje krypteringsschema och separata innehållsnycklar för specifika spår |
|
| customKeyAcquisitionUrlTemplate |
|
Mall för URL:en för den anpassade tjänsten som levererar nycklar till slutanvändarspelare. Krävs inte när du använder Azure Media Services för att utfärda nycklar. Mallen stöder utbytbara token som tjänsten uppdaterar vid körning med det värde som är specifikt för begäran. De tokenvärden som stöds för närvarande är {AlternativeMediaId}, som ersätts med värdet för StreamingLocatorId.AlternativeMediaId och {ContentKeyId}, som ersätts med värdet för identifieraren för nyckeln som begärs. |
| enabledProtocols |
Representerar protokoll som stöds |
NoEncryption
Klass för NoEncryption-schema
| Name | Type | Description |
|---|---|---|
| enabledProtocols |
Representerar protokoll som stöds |
ODataError
Information om ett fel.
| Name | Type | Description |
|---|---|---|
| code |
|
Ett språkoberoende felnamn. |
| details |
Felinformationen. |
|
| message |
|
Felmeddelandet. |
| target |
|
Målet för felet (till exempel namnet på egenskapen i fel). |
StreamingPolicy
En resurs för direktuppspelningsprincip
| Name | Type | Description |
|---|---|---|
| id |
|
Fullständigt kvalificerat resurs-ID för resursen. Exempel : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
| name |
|
Namnet på resursen |
| properties.commonEncryptionCbcs |
Konfiguration av CommonEncryptionCbcs |
|
| properties.commonEncryptionCenc |
Konfiguration av CommonEncryptionCenc |
|
| properties.created |
|
Skapandetid för direktuppspelningsprincip |
| properties.defaultContentKeyPolicyName |
|
Standardinnehållsnyckel som används av den aktuella strömningsprincipen |
| properties.envelopeEncryption |
Konfiguration av EnvelopeEncryption |
|
| properties.noEncryption |
Konfigurationer av NoEncryption |
|
| systemData |
Systemmetadata som rör den här resursen. |
|
| type |
|
Typen av resurs. T.ex. "Microsoft.Compute/virtualMachines" eller "Microsoft. Storage/storageAccounts" |
StreamingPolicyContentKey
Klass för att ange egenskaper för innehållsnyckeln
| Name | Type | Description |
|---|---|---|
| label |
|
Etikett kan användas för att ange innehållsnyckel när du skapar en positionerare för direktuppspelning |
| policyName |
|
Princip som används av innehållsnyckeln |
| tracks |
Spårar som använder den här innehållsnyckeln |
StreamingPolicyContentKeys
Klass för att ange egenskaper för alla innehållsnycklar i strömningsprincip
| Name | Type | Description |
|---|---|---|
| defaultKey |
Standardinnehållsnyckel för ett krypteringsschema |
|
| keyToTrackMappings |
För att representera spår behöver du en separat innehållsnyckel |
StreamingPolicyFairPlayConfiguration
Klass för att ange konfigurationer av FairPlay i direktuppspelningsprincip
| Name | Type | Description |
|---|---|---|
| allowPersistentLicense |
|
Alla licenser ska vara beständiga eller inte |
| customLicenseAcquisitionUrlTemplate |
|
Mall för URL:en för den anpassade tjänsten som levererar licenser till slutanvändarspelare. Krävs inte när du använder Azure Media Services för att utfärda licenser. Mallen stöder utbytbara token som tjänsten uppdaterar vid körning med det värde som är specifikt för begäran. De tokenvärden som stöds för närvarande är {AlternativeMediaId}, som ersätts med värdet för StreamingLocatorId.AlternativeMediaId och {ContentKeyId}, som ersätts med värdet för identifieraren för nyckeln som begärs. |
StreamingPolicyPlayReadyConfiguration
Klass för att ange konfigurationer av PlayReady i strömningsprincip
| Name | Type | Description |
|---|---|---|
| customLicenseAcquisitionUrlTemplate |
|
Mall för URL:en för den anpassade tjänsten som levererar licenser till slutanvändarspelare. Krävs inte när du använder Azure Media Services för att utfärda licenser. Mallen stöder utbytbara token som tjänsten uppdaterar vid körning med det värde som är specifikt för begäran. De tokenvärden som stöds för närvarande är {AlternativeMediaId}, som ersätts med värdet för StreamingLocatorId.AlternativeMediaId och {ContentKeyId}, som ersätts med värdet för identifieraren för nyckeln som begärs. |
| playReadyCustomAttributes |
|
Anpassade attribut för PlayReady |
StreamingPolicyWidevineConfiguration
Klass för att ange konfigurationer av Widevine i strömningsprincip
| Name | Type | Description |
|---|---|---|
| customLicenseAcquisitionUrlTemplate |
|
Mall för URL:en för den anpassade tjänsten som levererar licenser till slutanvändarspelare. Krävs inte när du använder Azure Media Services för att utfärda licenser. Mallen stöder utbytbara token som tjänsten uppdaterar vid körning med det värde som är specifikt för begäran. De tokenvärden som stöds för närvarande är {AlternativeMediaId}, som ersätts med värdet för StreamingLocatorId.AlternativeMediaId och {ContentKeyId}, som ersätts med värdet för identifieraren för nyckeln som begärs. |
systemData
Metadata som rör skapande och senaste ändring av resursen.
| Name | Type | Description |
|---|---|---|
| createdAt |
|
Tidsstämpeln för resursskapande (UTC). |
| createdBy |
|
Den identitet som skapade resursen. |
| createdByType |
Den typ av identitet som skapade resursen. |
|
| lastModifiedAt |
|
Tidsstämpeln för resursens senaste ändring (UTC) |
| lastModifiedBy |
|
Den identitet som senast ändrade resursen. |
| lastModifiedByType |
Den typ av identitet som senast ändrade resursen. |
TrackPropertyCompareOperation
Spåra åtgärd för egenskapsvillkor
| Name | Type | Description |
|---|---|---|
| Equal |
|
Lika med-åtgärd |
| Unknown |
|
Jämförelseåtgärd för okänd track-egenskap |
TrackPropertyCondition
Klass för att ange ett villkor för spåregenskap
| Name | Type | Description |
|---|---|---|
| operation |
Spåra åtgärden för egenskapsvillkor |
|
| property |
Spåra egenskapstyp |
|
| value |
|
Spåra egenskapsvärde |
TrackPropertyType
Spåra egenskapstyp
| Name | Type | Description |
|---|---|---|
| FourCC |
|
Spåra FourCC |
| Unknown |
|
Okänd spåregenskap |
TrackSelection
Klass för att välja ett spår
| Name | Type | Description |
|---|---|---|
| trackSelections |
TrackSelections är en villkorslista för spåregenskap som kan ange spår |