通过媒体服务 v3 管理流式处理终结点Manage streaming endpoints with Media Services v3

媒体服务徽标 v3media services logo v3


创建媒体服务帐户后,一个处于“已停止”状态的默认流式处理终结点会添加到帐户。 When your Media Services account is created a default Streaming Endpoint is added to your account in the Stopped state. 若要开始对内容进行流式处理并利用动态打包动态加密功能,必须确保要从其流式获取内容的流式处理终结点处于“正在运行”状态。 To start streaming your content and take advantage of dynamic packaging and dynamic encryption, the streaming endpoint from which you want to stream content has to be in the Running state.

本文介绍如何使用不同的技术在流式处理终结点上执行 start 命令。This article shows you how to execute the start command on your streaming endpoint using different technologies.

备注

仅当流式处理终结点处于运行状态时才进行计费。You are only billed when your Streaming Endpoint is in running state.

先决条件Prerequisites

内容回顾:Review:

使用 RESTUse REST

POST https://management.chinacloudapi.cn/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mediaresources/providers/Microsoft.Media/mediaservices/slitestmedia10/streamingEndpoints/myStreamingEndpoint1/start?api-version=2018-07-01

有关详细信息,请参阅:For more information, see:

使用 Azure 门户Use the Azure portal

  1. 登录到 Azure 门户Sign in to the Azure portal.
  2. 转到 Azure 媒体服务帐户。Go to your Azure Media Services account.
  3. 在左窗格中,选择“流式处理终结点”。 In the left pane, select Streaming Endpoints.
  4. 选择要启动的流式处理终结点,然后选择“启动”。 Select the streaming endpoint you want to start, and then select Start.

使用 Azure CLIUse the Azure CLI

az ams streaming-endpoint start [--account-name]
                                [--ids]
                                [--name]
                                [--no-wait]
                                [--resource-group]
                                [--subscription]

有关详细信息,请参阅 az ams streaming-endpoint startFor more information, see az ams streaming-endpoint start.

使用 SDKUse SDKs

JavaJava

if (streamingEndpoint != null) {
// Start The Streaming Endpoint if it is not running.
if (streamingEndpoint.resourceState() != StreamingEndpointResourceState.RUNNING) {
    manager.streamingEndpoints().startAsync(config.getResourceGroup(), config.getAccountName(), STREAMING_ENDPOINT_NAME).await();
}

请参阅完整的 Java 代码示例See the complete Java code sample.

.NET.NET

StreamingEndpoint streamingEndpoint = await client.StreamingEndpoints.GetAsync(config.ResourceGroup, config.AccountName, DefaultStreamingEndpointName);

if (streamingEndpoint != null)
{
    if (streamingEndpoint.ResourceState != StreamingEndpointResourceState.Running)
    {
        await client.StreamingEndpoints.StartAsync(config.ResourceGroup, config.AccountName, DefaultStreamingEndpointName);
    }

请参阅完整的 .NET 代码示例See the complete .NET code sample.


后续步骤Next steps