Nitin Aggarwal
Nitin Aggarwal

Reputation: 461

How to play MKV file in browser?

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.

Upvotes: 28

Views: 85766

Answers (4)

Mm.Mirzaei.dev
Mm.Mirzaei.dev

Reputation: 363

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>
if you do not understand, click on link

Play Code

Upvotes: -2

MiOVieira
MiOVieira

Reputation: 21

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

Upvotes: 2

Matt Joiner
Matt Joiner

Reputation: 118620

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.

Upvotes: 20

david souza
david souza

Reputation: 81

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".

Upvotes: 8

Related Questions