媒体服务迁移代码示例比较Media Services migration code sample comparison

迁移指南徽标


比较 SDKCompare the SDKs

可以使用一些代码示例来比较 SDK 之间的操作方式。You can use some of our code samples to compare the way things are done between SDKs.

用于比较的示例Samples for comparison

下表列出了在常见方案中用于比较 v2 和 v3 的示例。The following table is a listing of samples for comparison between v2 and v3 for common scenarios.

方案Scenario v2 APIv2 API v3 APIv3 API
创建资产并上传文件Create an asset and upload a file v2 .NET 示例v2 .NET example v3 .NET 示例v3 .NET example
提交作业Submit a job v2 .NET 示例v2 .NET example v3 .NET 示例v3 .NET example

演示如何先创建转换,再提交作业。Shows how to first create a Transform and then submit a Job.
发布使用 AES 加密的资产Publish an asset with AES encryption 1.创建 ContentKeyAuthorizationPolicyOption1. Create ContentKeyAuthorizationPolicyOption
2.创建 ContentKeyAuthorizationPolicy2. Create ContentKeyAuthorizationPolicy
3.创建 AssetDeliveryPolicy3. Create AssetDeliveryPolicy
4.创建 Asset 并上传内容或提交 Job 并使用 OutputAsset4. Create Asset and upload content OR submit Job and use OutputAsset
5.将 AssetDeliveryPolicyAsset 关联5. Associate AssetDeliveryPolicy with Asset
6.创建 ContentKey6. Create ContentKey
7.将 ContentKey 附加到 Asset7. Attach ContentKey to Asset
8.创建 AccessPolicy8. Create AccessPolicy
9.创建 Locator9. Create Locator

v2 .NET 示例v2 .NET example
1.创建 ContentKeyPolicy1. Create ContentKeyPolicy
2.创建 Asset2. Create Asset
3.上传内容或将 Asset 用作 JobOutput3. Upload content or use Asset as JobOutput
4.创建 StreamingLocator4. Create StreamingLocator

v3 .NET 示例v3 .NET example
获取作业详细信息和管理作业Get job details and manage jobs 使用 v2 管理作业Manage jobs with v2 使用 v3 管理作业Manage jobs with v3