Streaming Video from Azure Blob Storage

By default Azure Blob Storage and Video do not mix well; the first hurdle that developers must get over is that the Content Type for the video must be set correctly (for .mp4 videos that’s usually video/mp4).

The next problem that you’ll face is that the video will not seek correctly; trying to jump forward or backwards in the video won’t work.

This is resolved by changing the DefaultServiceVersion to 2011-08-18 which can be achieved via the Azure’s REST API, or the Managed C# Library as laid out at the end of this blog post.

var account = CloudStorageAccount.Parse(ConnectionString);
var blobClient = account.CreateCloudBlobClient();
blobClient.SetServiceSettings(new ServiceSettings()
        {
            DefaultServiceVersion = "2011-08-18"
        });

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>