5

将视频预加载为Blob,然后用于createObjectURL()创建 BlobURL。该视频在所有操作系统/浏览器上播放,但在 iOS 10.3 上尝试播放(承诺)消息时被拒绝:

NotSupportedError (DOM Exception 9): The operation is not supported.

如果将<video>src 切换到正常的视频 url,它会正常播放。

获取 blob url 的代码:

fetch(videoURL)
  .then(response => response.blob())
  .then(window.URL.createObjectURL)
  .then(console.log)
4

0 回答 0