Jon*_*ves 9 c# azure azure-storage-blobs html5-video
我正在尝试从Azure Blob存储中提供MP4视频内容.通过确保将Blob的内容类型设置为video/mp4
,我可以在现代浏览器中播放视频; 但是我无法向后寻求.
将相同的视频放入S3存储桶会产生所需的结果,因此我排除了内容的问题.
我是否需要以特定方式配置存储角色以提供视频内容?
avs*_*099 10
我不清楚@ smarx的答案如何为我的blob容器设置 - 但是经过一些谷歌搜索我找到了下面的代码.只需在LINQPad中执行它,视频就会开始流式传输:
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);
Run Code Online (Sandbox Code Playgroud)
小智 7
对于任何想要使用 Azure CLI 的人:
az storage account blob-service-properties update --account-name [account_name] --default-service-version '2020-10-02'
Run Code Online (Sandbox Code Playgroud)
您可以尝试将存储帐户的默认版本设置为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.它改进了范围请求的一些内容(可能是浏览器中的渐进式下载正在进行的操作).我没有听到任何关于视频播放的具体内容,但尝试不会有什么坏处.:-)
归档时间: |
|
查看次数: |
7583 次 |
最近记录: |