Serving Azure Blob video content

I am trying to submit an MP4 video from Azure Blob repository. I can make videos play in modern browsers, ensuring that the Blob content type is set to video/mp4 ; however, I cannot look back.

Dropping the same video into the S3 bucket gives the desired result, so I am fixing content issues.

Do I need to configure the storage role in a certain way to serve video content?

+9
c # html5-video azure azure-storage-blobs
source share
5 answers

I was not clear from @smarx's answer how to set this for my blob container, but after some searching, I found the code below. Just run it in LINQPad and the video will start streaming:

 var storageAccount = CloudStorageAccount.Parse("AccountName=<accountName>;AccountKey=<accountKeyBase64>;DefaultEndpointsProtocol=http"); var blobClient = storageAccount.CreateCloudBlobClient(); // Get the current service properties var serviceProperties = blobClient.GetServiceProperties(); // Set the default service version to 2011-08-18 (or a higher version like 2012-03-01) serviceProperties.DefaultServiceVersion = "2011-08-18"; // Save the updated service properties blobClient.SetServiceProperties(serviceProperties); 
+10
source share

You can try setting the default version for your storage account before 2011-08-18: http://blogs.msdn.com/b/windowsazurestorage/archive/2011/09/15/windows-azure-blobs-improved-http -headers-for-resume-on-download-and-a-change-in-if-match-conditions.aspx . This improves a couple of things around range requests (possibly what happens with progressive loading in your browser). I haven’t heard anything specific about playing the video, but it won’t stop trying .:-)

+5
source share

I tried playing a very small MP4 encoded block directly from an HTML5 video element with controls turned on, I could use the control to scroll back and forth my video.

What is the size of your video content? You can also use Fiddler to check the HTTP headers to check if they are expected or match when you use the same blob from the S3 bucket?

If you can share the link on blob, I can quickly try and see what might be the problem.

0
source share

You can do this through Powershell. Here is an example for Azures ARM (not classic, but you can easily convert it).

 Select-AzureRmSubscription -SubscriptionName "subscription" $Name = 'storageaccountname' $resourcegroup = 'resourcegroup' $sp = New-Object -TypeName Microsoft.WindowsAzure.Storage.Shared.Protocol.ServiceProperties $sp.DefaultServiceVersion = "2017-04-17" $key = (Get-AzureRMStorageAccountKey -StorageAccountName $Name -ResourceGroupName $resourcegroup).Value[1] $context = New-AzureStorageContext -StorageAccountName $Name -StorageAccountKey $key $blobClient = $context.StorageAccount.Create 
0
source share

For those who come here from Google:

Azure has two types of storage accounts: StorageV1 / V2 (the default option is selected when creating a new account) and BlobStorage .

Although the StorageV2 option may have more features, it does not support and does not support partial content requests , that is, Chrome does not allow video search.

You can determine the type of storage in the Azure portal by going to your storage account> Properties> Account Type.

0
source share

All Articles