流式处理策略Streaming Policies

在 Azure 媒体服务 v3 中,使用流式处理策略可为流式处理定位符定义流式处理协议和加密选项。In Azure Media Services v3, Streaming Policies enable you to define streaming protocols and encryption options for your Streaming Locators. 媒体服务 v3 提供了一些预定义的流式处理策略,以便可以将它们直接用于试用版或生产版。Media Services v3 provides some predefined Streaming Policies so that you can use them directly for trial or production.

目前可用的预定义流式处理策略:The currently available predefined Streaming Policies:

  • 'Predefined_DownloadOnly''Predefined_DownloadOnly'
  • 'Predefined_ClearStreamingOnly''Predefined_ClearStreamingOnly'
  • 'Predefined_DownloadAndClearStreaming''Predefined_DownloadAndClearStreaming'
  • 'Predefined_ClearKey''Predefined_ClearKey'
  • 'Predefined_MultiDrmCencStreaming''Predefined_MultiDrmCencStreaming'
  • 'Predefined_MultiDrmStreaming''Predefined_MultiDrmStreaming'

以下“决策树”可帮助你为方案选择预定义的流式处理策略。The following "Decision tree" helps you choose a predefined Streaming Policy for your scenario.

重要

  • 属于日期时间类型的流式处理策略的属性始终采用 UTC 格式。Properties of Streaming Policies that are of the Datetime type are always in UTC format.
  • 应为媒体服务帐户设计一组有限的策略,并在需要相同的选项时重新将这些策略用于流式处理定位符。You should design a limited set of policies for your Media Service account and reuse them for your Streaming Locators whenever the same options are needed. 有关详细信息,请参阅配额和限制For more information, see Quotas and limits.

决策树Decision tree

单击图像查看其完整大小。Click the image to view it full size.

显示决策树的关系图,该决策树用于为你的场景选择预定义的流式处理策略。Diagram showing a decision tree that is designed to help you choose a predefined Streaming Policy for your scenario.

如果要加密内容,则需要创建内容密钥策略,明文流式处理或下载不需要内容密钥策略If encrypting your content, you need to create a Content Key Policy, the Content Key Policy is not needed for clear streaming or downloading.

如果有特殊要求(例如,如果想要指定不同的协议,需要使用自定义密钥传送服务,或者需要使用明文音频轨道),则可以创建自定义流式处理策略。If you have special requirements (for example, if you want to specify different protocols, need to use a custom key delivery service, or need to use a clear audio track), you can create a custom Streaming Policy.

获取流式处理策略定义Get a Streaming Policy definition

若要查看流式处理策略的定义,请使用 Get 并指定策略名称。If you want to see the definition of a Streaming Policy, use Get and specify the policy name. 例如:For example:

RESTREST

请求:Request:

GET https://management.chinacloudapi.cn/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaServices/contosomedia/streamingPolicies/clearStreamingPolicy?api-version=2018-07-01

响应:Response:

{
  "name": "clearStreamingPolicy",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Media/mediaservices/contosomedia/streamingPolicies/clearStreamingPolicy",
  "type": "Microsoft.Media/mediaservices/streamingPolicies",
  "properties": {
    "created": "2018-08-08T18:29:30.8501486Z",
    "noEncryption": {
      "enabledProtocols": {
        "download": true,
        "dash": true,
        "hls": true,
        "smoothStreaming": true
      }
    }
  }
}

筛选、排序、分页Filtering, ordering, paging

请参阅媒体服务实体的筛选、排序、分页See Filtering, ordering, paging of Media Services entities.

后续步骤Next steps