Hi,
Switch Video Quality sets the mime type of a video automatically, either as identified by WordPress or (in case of an external url) by checking the file extension of a video.
Matroska files are correctly identified as video/x-matroska.
So it’s actually not the plugin but the browser that doesn’t support playing an mkv-file natively.
While your hack may work for you with your test file, it’s not something I would advise to do for some reasons:
- You’re spoofing the mime type to pretend it’s an mp4 video. This might work if there’s an h.264 encoded video stream inside of your mkv file, but as matroska is only a container format, there could also be something else in there. I tried your hack with a h.263 video stream inside a mkv-container and it didn’t work at all.
- As you’re overwriting a dynamically generated value with a static value, all your video files now will be mime-typed as “video/mp4” (might work in your setup).
- When the plugin is updated, all your modifications will be lost.
By the way, your hack is only targeting the videos that are opened when you click on an item in the playlist. The data of the video that is served on page load is generated by php in the shortcode callback function.
I would recommend remuxing or transcoding your mkv-files to mp4 if you want them to be playing in modern browsers natively (without any add-ons).