Exemple #1
0
        public static MediaJobInput[] GetJobInputs(string authToken, MediaClient mediaClient, string storageAccount, bool storageEncryption,
                                                   string inputAssetName, bool multipleFileAsset, string[] fileNames)
        {
            List <MediaJobInput> jobInputs = new List <MediaJobInput>();

            if (multipleFileAsset)
            {
                IAsset        asset    = mediaClient.CreateAsset(authToken, inputAssetName, storageAccount, storageEncryption, fileNames);
                MediaJobInput jobInput = GetJobInput(asset);
                jobInputs.Add(jobInput);
            }
            else
            {
                foreach (string fileName in fileNames)
                {
                    string assetName = fileName;
                    if (fileNames.Length == 1 && !string.IsNullOrEmpty(inputAssetName))
                    {
                        assetName = inputAssetName;
                    }
                    IAsset        asset    = mediaClient.CreateAsset(authToken, assetName, storageAccount, storageEncryption, new string[] { fileName });
                    MediaJobInput jobInput = GetJobInput(asset);
                    jobInputs.Add(jobInput);
                }
            }
            return(jobInputs.ToArray());
        }