MediaTailor 使用示例 AWS CLI - AWS Command Line Interface

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

MediaTailor 使用示例 AWS CLI

以下代码示例向您展示了如何使用with来执行操作和实现常见场景 MediaTailor。 AWS Command Line Interface

操作是大型程序的代码摘录,必须在上下文中运行。您可以通过操作了解如何调用单个服务函数,还可以通过函数相关场景的上下文查看操作。

每个示例都包含一个指向完整源代码的链接,您可以在其中找到有关如何在上下文中设置和运行代码的说明。

主题

操作

以下代码示例显示了如何使用delete-playback-configuration

AWS CLI

删除配置

以下内容delete-playback-configuration删除名为的配置campaign_short

aws mediatailor delete-playback-configuration \ --name campaign_short

此命令不生成任何输出。

有关更多信息,请参阅 AWS Elemental MediaTailor 用户指南中的删除配置

以下代码示例显示了如何使用get-playback-configuration

AWS CLI

描述配置

下面get-playback-configuration显示了名为的配置的所有详细信息west_campaign

aws mediatailor get-playback-configuration \ --name west_campaign

输出:

{ "AdDecisionServerUrl": "http://your.ads.url", "CdnConfiguration": {}, "DashConfiguration": { "ManifestEndpointPrefix": "https://170c14299689462897d0cc45fc2000bb.mediatailor.us-west-2.amazonaws.com/v1/dash/1cbfeaaecb69778e0c167d0505a2bc57da2b1754/west_campaign/", "MpdLocation": "EMT_DEFAULT", "OriginManifestType": "MULTI_PERIOD" }, "HlsConfiguration": { "ManifestEndpointPrefix": "https://170c14299689462897d0cc45fc2000bb.mediatailor.us-west-2.amazonaws.com/v1/master/1cbfeaaecb69778e0c167d0505a2bc57da2b1754/west_campaign/" }, "Name": "west_campaign", "PlaybackConfigurationArn": "arn:aws:mediatailor:us-west-2:123456789012:playbackConfiguration/west_campaign", "PlaybackEndpointPrefix": "https://170c14299689462897d0cc45fc2000bb.mediatailor.us-west-2.amazonaws.com", "SessionInitializationEndpointPrefix": "https://170c14299689462897d0cc45fc2000bb.mediatailor.us-west-2.amazonaws.com/v1/session/1cbfeaaecb69778e0c167d0505a2bc57da2b1754/west_campaign/", "Tags": {}, "VideoContentSourceUrl": "https://8343f7014c0ea438.mediapackage.us-west-2.amazonaws.com/out/v1/683f0f2ff7cd43a48902e6dcd5e16dcf/index.m3u8" }

有关更多信息,请参阅 AWS Elemental MediaTailor 用户指南中的查看配置

以下代码示例显示了如何使用list-playback-configurations

AWS CLI

列出所有配置

下图list-playback-configurations显示了当前 AWS 账户的配置的所有详细信息。

aws mediatailor list-playback-configurations

输出:

{ "Items": [ { "AdDecisionServerUrl": "http://your.ads.url", "CdnConfiguration": {}, "DashConfiguration": { "ManifestEndpointPrefix": "https://170c14299689462897d0cc45fc2000bb.mediatailor.us-west-2.amazonaws.com/v1/dash/1cbfeaaecb69778e0c167d0505a2bc57da2b1754/west_campaign/", "MpdLocation": "EMT_DEFAULT", "OriginManifestType": "MULTI_PERIOD" }, "HlsConfiguration": { "ManifestEndpointPrefix": "https://170c14299689462897d0cc45fc2000bb.mediatailor.us-west-2.amazonaws.com/v1/master/1cbfeaaecb69778e0c167d0505a2bc57da2b1754/west_campaign/" }, "Name": "west_campaign", "PlaybackConfigurationArn": "arn:aws:mediatailor:us-west-2:123456789012:playbackConfiguration/west_campaign", "PlaybackEndpointPrefix": "https://170c14299689462897d0cc45fc2000bb.mediatailor.us-west-2.amazonaws.com", "SessionInitializationEndpointPrefix": "https://170c14299689462897d0cc45fc2000bb.mediatailor.us-west-2.amazonaws.com/v1/session/1cbfeaaecb69778e0c167d0505a2bc57da2b1754/west_campaign/", "Tags": {}, "VideoContentSourceUrl": "https://8343f7014c0ea438.mediapackage.us-west-2.amazonaws.com/out/v1/683f0f2ff7cd43a48902e6dcd5e16dcf/index.m3u8" }, { "AdDecisionServerUrl": "http://your.ads.url", "CdnConfiguration": {}, "DashConfiguration": { "ManifestEndpointPrefix": "https://73511f91d6a24ca2b93f3cf1d7cedd67.mediatailor.us-west-2.amazonaws.com/v1/dash/1cbfeaaecb69778e0c167d0505a2bc57da2b1754/sports_campaign/", "MpdLocation": "DISABLED", "OriginManifestType": "MULTI_PERIOD" }, "HlsConfiguration": { "ManifestEndpointPrefix": "https://73511f91d6a24ca2b93f3cf1d7cedd67.mediatailor.us-west-2.amazonaws.com/v1/master/1cbfeaaecb69778e0c167d0505a2bc57da2b1754/sports_campaign/" }, "Name": "sports_campaign", "PlaybackConfigurationArn": "arn:aws:mediatailor:us-west-2:123456789012:playbackConfiguration/sports_campaign", "PlaybackEndpointPrefix": "https://73511f91d6a24ca2b93f3cf1d7cedd67.mediatailor.us-west-2.amazonaws.com", "SessionInitializationEndpointPrefix": "https://73511f91d6a24ca2b93f3cf1d7cedd67.mediatailor.us-west-2.amazonaws.com/v1/session/1cbfeaaecb69778e0c167d0505a2bc57da2b1754/sports_campaign/", "SlateAdUrl": "http://s3.bucket/slate_ad.mp4", "Tags": {}, "VideoContentSourceUrl": "https://c4af3793bf76b33c.mediapackage.us-west-2.amazonaws.com/out/v1/1dc6718be36f4f34bb9cd86bc50925e6/sports_endpoint/index.m3u8" } ] }

有关更多信息,请参阅《基本用户指南》中的查看配置 < https://docs.aws.amazon.com/mediatailor/ latest/ug/configurations-view.html>。AWS MediaTailor

以下代码示例显示了如何使用put-playback-configuration

AWS CLI

创建配置

以下内容put-playback-configuration创建了一个名为的配置campaign_short

aws mediatailor put-playback-configuration \ --name campaign_short \ --ad-decision-server-url http://your.ads.url \ --video-content-source-url http://video.bucket/index.m3u8

输出:

{ "AdDecisionServerUrl": "http://your.ads.url", "CdnConfiguration": {}, "DashConfiguration": { "ManifestEndpointPrefix": "https://13484114d38f4383bc0d6a7cb879bd00.mediatailor.us-west-2.amazonaws.com/v1/dash/1cbfeaaecb69778e0c167d0505a2bc57da2b1754/campaign_short/", "MpdLocation": "EMT_DEFAULT", "OriginManifestType": "MULTI_PERIOD" }, "HlsConfiguration": { "ManifestEndpointPrefix": "https://13484114d38f4383bc0d6a7cb879bd00.mediatailor.us-west-2.amazonaws.com/v1/master/1cbfeaaecb69778e0c167d0505a2bc57da2b1754/campaign_short/" }, "Name": "campaign_short", "PlaybackConfigurationArn": "arn:aws:mediatailor:us-west-2:123456789012:playbackConfiguration/campaign_short", "PlaybackEndpointPrefix": "https://13484114d38f4383bc0d6a7cb879bd00.mediatailor.us-west-2.amazonaws.com", "SessionInitializationEndpointPrefix": "https://13484114d38f4383bc0d6a7cb879bd00.mediatailor.us-west-2.amazonaws.com/v1/session/1cbfeaaecb69778e0c167d0505a2bc57da2b1754/campaign_short/", "Tags": {}, "VideoContentSourceUrl": "http://video.bucket/index.m3u8" }

有关更多信息,请参阅 AWS Elemental MediaTailor 用户指南中的创建配置