Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I tell the browser to open an avi file with VLC or similar in HTML?

Tags:

html

vlc

avi

So I have a list of avi files on a web page (For my own purposes!), and was wondering what do I have to put into the html code to tell the browser to open VLC? or mplayer or simliar?

like image 887
chutsu Avatar asked Nov 24 '25 09:11

chutsu


1 Answers

You should make sure that your web server is serving up the avi files with the appropriate Content-Type HTTP header.

Content-Type: video/x-msvideo

-- mime type reference.

This will cause the client's default player associated with the given Content-Type to load with the player. The client's default player will differ from user to user depending on their OS, installed programs and file association settings. For most windows users, this will be Media Player (unless the user has customized the default setting). For Mac users it will be something else (eg. VLC if they've installed it, or maybe Quicktime, if they've installed Flip4Mac). If the client doesn't have support for the given mime type, the browser will treat it as a file download.

like image 69
Asaph Avatar answered Nov 27 '25 00:11

Asaph



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!