gpt4 book ai didi

ios - 从照片库中选择视频时,仅适用于 iOS 13.2 上 Ionic 中的视频的文件大小为 0

转载 作者:行者123 更新时间:2023-12-04 14:33:25 25 4
gpt4 key购买 nike

在我的 Ionic3 应用程序中,我计算文件大小如下。

HTML

<div>
<input type="file" accept="*" (change)="onSelect($event)">
<button ion-button (click)="calcSize()">calculate size</button>
</div>
<p>Size: {{ size }}</p>

TS
  file: File;
size: number;

onSelect(event: any) {

this.file = event.target.files[0];
}
calcSize() {

this.size = this.file.size;
}

以上代码在 iOS 13.2 以下的所有 Android 设备和 iOS 设备上都能完美运行。

但是 在 iOS 13.2 以上的设备上从照片库中选择视频时,size仅对于视频文件为 0 .

但是 从 iCloud Drive 选择视频时工作正常。

任何帮助都受到高度赞赏。

StackBlitz 上查找问题.

最佳答案

我认为它不是 ionic 错误。规范说明如下:

On getting, conforming user agents must return the total number of bytes



https://w3c.github.io/FileAPI/

好像是ios的bug。

关于ios - 从照片库中选择视频时,仅适用于 iOS 13.2 上 Ionic 中的视频的文件大小为 0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58975049/

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