确保API响应中的Blob对象是正确的视频格式,并且已经正确地存储到数据库中。
在前端代码中使用Blob URL来播放视频,如下例所示:
fetch('API_URL') .then(response => response.blob()) .then(blob => { const blobUrl = URL.createObjectURL(blob); const video = document.getElementById('video-player'); video.src = blobUrl; video.play(); }) .catch(error => console.error(error));