可在 html5 中下载 link
downloadable link in html5
我正在尝试使 html 中的 audio/video 文件可下载,但它会在另一个选项卡中打开。
在这两种情况下,我都使用锚标记 link 到文件。
<div id="video">
<figure>
<video src="video/myfile.mp4"
poster="images/sackboy.jpg"
type='video/mp4;codecs="avc1.42E01E, mp4a.40.2"'
preload
loop
controls
none
width="600"
height="300"
id="videotag">
</video>
<figcaption>
<em>This video meant to enlighten people on games and how they are made.</em>
</figcaption>
<a href="http//:video/myfile.mp4">Download</a>
</figure>
</div>
您可以使用目标属性。正常情况下会在同框内打开
也许如果你添加 _self 它会起作用:
<a href="link" target="_self">Link</a>
我正在尝试使 html 中的 audio/video 文件可下载,但它会在另一个选项卡中打开。
在这两种情况下,我都使用锚标记 link 到文件。
<div id="video">
<figure>
<video src="video/myfile.mp4"
poster="images/sackboy.jpg"
type='video/mp4;codecs="avc1.42E01E, mp4a.40.2"'
preload
loop
controls
none
width="600"
height="300"
id="videotag">
</video>
<figcaption>
<em>This video meant to enlighten people on games and how they are made.</em>
</figcaption>
<a href="http//:video/myfile.mp4">Download</a>
</figure>
</div>
您可以使用目标属性。正常情况下会在同框内打开
也许如果你添加 _self 它会起作用:
<a href="link" target="_self">Link</a>