问题
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