by
0
5
882
0
Top 5% !
Popular
Easy-to-find
Specified
OpenSource
Popularity: 30229th place
Created
Modified Jan 12, 2015

Published on:

LanguageCSharp
LicenseMIT_X11
OSWindows

IngestMultipleFiles: Uploads multiple files. If the set of files contains an .ism file,            sets it as a primary.

<summary>
Uploads multiple files. If the set of files contains an .ism file, 
sets it as a primary.
</summary>
<param name="multiFileDir">The location of the files.</param>
<param name="assetCreationOptions">
 You can specify the following encryption options for the AssetCreationOptions.
     None:  no encryption.  
     StorageEncrypted: storage encryption. Encrypts a clear input file 
       before it is uploaded to Azure storage. 
     CommonEncryptionProtected: for Common Encryption Protected (CENC) files. 
       For example, a set of files that are already PlayReady encrypted. 
     EnvelopeEncryptionProtected: for HLS with AES encryption files.
       NOTE: The files must have been encoded and encrypted by Transform Manager. 
    </param>
<returns></returns>
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/289399/IngestMultipleFiles--Uploads-multiple-fi?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
using Microsoft.WindowsAzure.MediaServices.Client; using System; using System.Collections.Generic; using System.Configuration; using System.IO; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Xml.Linq; private static CloudMediaContext _context = null; /// <summary> /// Uploads multiple files. If the set of files contains an .ism file, /// sets it as a primary. /// </summary> /// <param name="multiFileDir">The location of the files.</param> /// <param name="assetCreationOptions"> /// You can specify the following encryption options for the AssetCreationOptions. /// None: no encryption. /// StorageEncrypted: storage encryption. Encrypts a clear input file /// before it is uploaded to Azure storage. /// CommonEncryptionProtected: for Common Encryption Protected (CENC) files. /// For example, a set of files that are already PlayReady encrypted. /// EnvelopeEncryptionProtected: for HLS with AES encryption files. /// NOTE: The files must have been encoded and encrypted by Transform Manager. /// </param> /// <returns></returns> private static IAsset IngestMultipleFiles(string multiFileDir, AssetCreationOptions assetCreationOptions) { // Use the SDK extension method to create a new asset by // uploading files from a local directory. IAsset asset = _context.Assets.CreateFromFolder( multiFileDir, assetCreationOptions, (af, p) => { Console.WriteLine("Uploading '{0}' - Progress: {1:0.##}%", af.Name, p.Progress); }); return asset; }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus