管理 Android 设备上的 Microsoft Edge 中的媒体播放问题和设置
video 标签无法播放来自URL.createObjectURL()创建的链接。会显示视频已损坏图标。
管理 Android 设备上的 Microsoft Edge 中的媒体播放问题和设置
Hello,
The most common cause in Edge is that the object URL is being revoked too early. If you call URL.revokeObjectURL right after assigning video.src, Edge may show the broken video icon because the decoder has not finished reading from the blob yet.
Wrong pattern:
const url = URL.createObjectURL(blob);
video.src = url;
URL.revokeObjectURL(url); // too early in Edge
Correct pattern. Revoke only after the media is ready:
const url = URL.createObjectURL(blob);
video.src = url;
video.addEventListener('loadeddata', () => {
URL.revokeObjectURL(url);
});
If you attach sources dynamically, you can also wait for canplay or canplaythrough. As a quick test, simply remove the revoke line and reload. If the video plays, the timing was the issue.
If this change does not help, tell me and I will walk you through the next fix.