Open external link in Windows Media Player

Asked

Viewed 1,269 times

1

I have an offline HTML page that contains a link to a video MP4, I would like that when you click on that link, open the Media Player or other software that you have installed and preset on the computer to play the video, it is possible to do this?

1 answer

0


You need to use the file:/// (yes, it’s three bars), if you want to connect to local files.

<a href="file:///C:\Programas\meu_arquivo.mw"> Link 1 </a>
<a href="file:///C:\Videos\meuo_utro_arquivo.mp4"> Link 2 </a>

Links will not open the files in your local apps automatically.

This happens for security reasons. If it opens, it will only open in the browser. If your browser can display the file, it will. If the browser fails, it will probably ask if you want to download it. Some browsers, such as modern versions of Chrome, may even refuse to move from http protocol to file protocol.

Files will continue to open in your browser, and this is good!

Your browser will respond to these files in the same way that it will respond to files anywhere on the internet. These files will not open in your default application (eg Word, WMP or other browser), and you you won’t be able to do nothing like ask Windows Explorer to open the file location.

It is one of the most important points about safe web browsing.

Websites in your browser cannot interact with your system very well operational. If your website could say to meu_video.mp4 open in wmplayer.exe, a malicious site also could tell to open virus.bat in cmd.exe. Or can you just tell your PC to run some Uninstall.exe files, or to open file explorer a million times.

This may not be convenient for you, but HTML and browser security are not really designed for what you’re trying to do. If you really want to do this process, consider writing a desktop app.

I hope I made it clear, good luck.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.