简体   繁体   中英

Open video in default media player in HTML

I am trying to open a video in my default media player. I have inserted video hyperlinks in my HTML document.

When I click on the hyperlink, instead of opening the video, it downloads the video.

I want the hyperlink to open the video in the user's default media player without downloading the video.

This is what I have so far:

<a href="file://F:\Users\Public\Videos\Sample Videos\Wildlife.wmv">Example tutorial video</a>

Please advise. Thank you.

That's simply not how you embed video in html5. This is:

<video width="320" height="240" controls>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>

您不能不下载就打开默认媒体播放器,但是如果愿意,您可以只用html5视频播放器制作页面,如Mayers所说。

This is how you can use video tag in html5:

code:

<!DOCTYPE html> 
<html> 
<body> 

<video width="400" controls>
  <source src="mov_bbb.mp4" type="video/mp4">
  <source src="mov_bbb.ogg" type="video/ogg">
  Your browser does not support HTML5 video.
</video>

<p>
Video courtesy of 
<a href="https://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.
</p>

</body> 
</html>

source: https://www.w3schools.com/html/html5_video.asp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM