最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Download a video.mp4 from blob url - Stack Overflow

programmeradmin0浏览0评论

I have a video that is dynamic and in its src property is a link like this:

blob:

I need to create something for the user to click and from this click perform the video download. I can't use the html video tag download button.

NOTE: I tried this method but the downloaded video does not play.

JavaScript blob filename without link

I have a video that is dynamic and in its src property is a link like this:

blob:https://www.xxxxx./3e5431bc-2443-4651-b363-a386a73c8129

I need to create something for the user to click and from this click perform the video download. I can't use the html video tag download button.

NOTE: I tried this method but the downloaded video does not play.

JavaScript blob filename without link

Share Improve this question edited Dec 4, 2019 at 19:30 Samuel Maia asked Dec 4, 2019 at 19:11 Samuel MaiaSamuel Maia 411 gold badge1 silver badge4 bronze badges 2
  • Does this answer your question? JavaScript blob filename without link – Arkerone Commented Dec 4, 2019 at 19:15
  • @Arkerone The downloaded video cannot play with this method. – Samuel Maia Commented Dec 4, 2019 at 19:28
Add a ment  | 

1 Answer 1

Reset to default 4

If you actually had a full MP4 file at that URL, you could simply link to it.

<a href="blob:https://example./3e5431bc-2443-4651-b363-a386a73c8129" download>Download</a>

Since you said this doesn't work, I suspect that you don't actually have a blob, but the URL is referencing a MediaSource via Media Source Extensions. If that's the case, there is no generic way to reconstruct the video. You will need to figure out what mechanism is being used for streaming (like DASH or HLS) and reconstruct a video file yourself.

发布评论

评论列表(0)

  1. 暂无评论