简体   繁体   中英

Cannot Publish Encoded Asset in Azure Media Services

I'm having a problem publishing an encoded asset in Azure Media Services.

I can see that my asset is being created and encoded because it displays in my Media Services account but the "publish" functionality fails. I can successfully publish any asset that is created and encoded by my application, by hitting the publish button in the portal. However, I need to be able to do it programmatically. This is my method. I don't get any errors...

   `private static IAsset PublishAsset(IJob job)
    {
        var preparedAsset = job.OutputMediaAssets.FirstOrDefault();
        var ismAssetFiles = preparedAsset.AssetFiles.ToList().
          Where(f => f.Name.EndsWith(".ism", StringComparison.OrdinalIgnoreCase))
          .ToArray();

        ismAssetFiles.First().IsPrimary = true;
        ismAssetFiles.First().Update();
        return preparedAsset;

    }`

Can anyone see what I'm doing wrong?

The pasted code does not publish the asset but only mark the .ism file as primary file in the asset.

To publish the asset, you should create an access locator as explained here: https://azure.microsoft.com/en-us/documentation/articles/media-services-dotnet-get-started/#publish-the-asset-and-get-urls-for-streaming-and-progressive-download

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM