How to play MKV file in browser?

Nitin Aggarwal picture Nitin Aggarwal · Jun 10, 2013 · Viewed 62.3k times · Source

I have a video file in MKV format, i want to play that file in the browser without converting, how can i play this file format in browser?

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

i want this file to be played in full screen mode always. My browser is chrome.

Answer

Matt Joiner picture Matt Joiner · Dec 2, 2014

It will refuse to play Matroska if the type attribute is set to video/x-matroska. Try removing the type attribute completely.

After some experimentation with this issue, I've found the best solution is to set the mime type to video/webm.