26
votes

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.

5
Chrome should play MKV well. is the path correct ? and what's the Chrome version ?Raptor
Yes path is correct , chrome version is 27.0.1453.110Nitin Aggarwal
I'm asking Chrome's version. Another question shows Chrome can play MKV well: stackoverflow.com/questions/9622726/… ; what's your OS ?Raptor
try <video width="320" height="240" src="movie.mkv" controls></video>AlvinArulselvan
This is the file i'm playing auby.no/files/video_tests/…Nitin Aggarwal

5 Answers

18
votes

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.

7
votes

I think Chrome doesn't play .mkv videos.

By the way, 'type' is mime-type, and mkv's mime type is video/x-matroska.

Try:

source src="movie.mkv" type="video/x-matroska"

If this works, maybe the sound will be muted, so you can try type="video/mp4".

2
votes

I added the IIS Mime Type as (.mkv - video/webm) over the IIS option and it worked fine.

-1
votes

If you want to use video with path .mkv

<!-- mkv -->
  <video width="320" height="240" controls src="assets/animation.mkv"></video>
<!-- mp4 -->
  <video width="320" height="240" controls>
    <source src="assets/animation.mp4" type="video/mp4" />
  </video>

Play Code

-6
votes

I know this is old, but the best way is sending mkv to google drive. Google drive can play mkv with no problem. I don't know if you know, but you can have 15gb free on google drive, and you can embed it on your website.