gpt4 book ai didi

php - 编辑 Laravel Azure Blob 存储的 x-ms-version

转载 作者:行者123 更新时间:2023-12-03 02:28:35 25 4
gpt4 key购买 nike

我在使用 azure-laravel 流媒体视频时遇到问题(视频速度慢且无法搜索)。在 SO 中看到一个问题,这可能是 x-ms-version 导致的:here 。我找不到解决问题的方法,如下所述:here .

我需要编辑/指定我的 x-ms-version header 。在哪里可以找到属性 x-ms-version 以便更改它?

我找到了文件:vendor\microsoft\azure-storage\src\Common\Internal\Resources.php,但我没有名为:STORAGE_API_LATEST_VERSION的属性

更新图片:

enter image description here

有人有什么想法吗?

我的媒体上传 Controller :(它有效,我可以上传文件)

 public function mediaUpload(Request $request)
{

$fileName = time() . '_' . $request->file->getClientOriginalName();
$url = $request->file('file')->storeAs($request->folder, $fileName, 'azure');

if ($url) {
$json = array(
'uploaded' => true,
'fileName' => basename($url),
'fileNameFolder' => $url,
'location' => $url,
);

return response()->json($json);
}
}

我在其中显示视频的 View 文件:

  <div class="flex flex-wrap sm:w-7/12 mx-auto mt-10 relative z-10">
<video id="player" playsinline controls :data-poster="$page.assetsUrl + video.thumbnail_path">
<source :src="$page.assetsUrl + video.video_path" type="video/mp4" />
</video>
</div>

我的 BlobResources.php:

const BLOB_SDK_VERSION = '1.5.2';
const STORAGE_API_LATEST_VERSION = '2017-11-09';

HERE是来自 azure blob 存储的有问题视频的链接:

最佳答案

<强>1。将默认服务版本设置为最新版本,以便可以验证行为。

使用 Azure Blob 时,STORAGE_API_LATEST_VERSION“azure-storage-php-1.5.2-blob\azure-storage-blob\src\Blob\Internal\BlobResources”中定义。 php”(最新版本1.5.2)。

enter image description here

<小时/>

<强>2。更改请求中指定的版本。

您可以使用带有 x-ms-version header 的 cURL 来请求 Blob API。

获取 Blob 的示例:https://stackoverflow.com/a/65002473/13308381

关于php - 编辑 Laravel Azure Blob 存储的 x-ms-version,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66011435/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com