从Azure的Blob存储服务的视频内容 [英] Serving Video Content from Azure Blob Storage
问题描述
我试图从服务的Azure Blob存储的MP4视频内容。我能得到视频,通过确保斑点的内容类型设置为视频/ MP4
现代浏览器中播放;然而,我无法寻求倒退。
I am trying to serve MP4 Video content from Azure Blob Storage. I can get the video to play in modern browsers by ensuring that the Blob's Content Type is set to video/mp4
; however I am unable to seek backwards.
删除相同的视频到S3桶产生期望的结果,所以我排除了问题的内容。
Dropping the same video into an S3 bucket yields the desired result so I am ruling out problems with the content.
我需要在一个特定的方式来配置存储角色服务的视频内容?
Do I need to configure the Storage role in a specific way to serve video content?
推荐答案
从@ smarx的回答是不清楚,我如何设置为我的blob容器 - 但一些谷歌上搜索后,我发现下面的code。就在LINQPad执行它,和视频将开始流:
it was not clear for me from @smarx's answer how to set that for my blob container - but after some googling i found the code below. Just execute it in LINQPad, and 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);
这篇关于从Azure的Blob存储服务的视频内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!