How to customize HTML5 Video Download Button

。_饼干妹妹 提交于 2021-01-01 06:41:19

问题


I am needing to download a video that is sourced from an HTML5 element. The issue is that I want the download button to be more visible.

<video controls disablepictureinpicture>
  <source src="https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4">
</video>
<a href="https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4" download>
Download Video (not functional)
</a>

This code provides two download buttons.

  • One hidden in the button menu of the HTML5 Video Player.

  • Another attempted in the <a>tag.
    The <a> tag navigates instead of downloads because of CORS.

Problem:
Is it possible for me to modify the <video> tag to make the download button immediately visible without having to download via the player's menu button?

Or for some javascript to click the download button from the media player?

来源:https://stackoverflow.com/questions/64864258/how-to-customize-html5-video-download-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!