Streaming Video from Azure Blob Storage
Posted on Fri 20 July 2012 in Azure
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 MSDN blog post.
var account = CloudStorageAccount.Parse(ConnectionString);
var blobClient = account.CreateCloudBlobClient();
blobClient.SetServiceSettings(new ServiceSettings()
{
DefaultServiceVersion = "2011-08-18"
});