• Resolved purplecandy

    (@purplecandy)


    Hey, I was trying to play some mkv files from player but it doesn’t work as it only plays mp4,webm and ogg. Before your plugin I was using Plyr Video Player that let’s me play same mkv files with html5 video codes like

    <video <source src="/.mkv" type="video/mp4" /> </video>
    I was trying to do the same in your plugin but didn’t get. Can you guide how and where the video structure are placed inside the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter purplecandy

    (@purplecandy)

    I actually fixed it
    It was under switch-video-quality/js/mep-feature-svq_playlist.js.
    Changed ‘ + svq_video[i].svq_mime + ‘ to video/mp4
    And now it’s supporting mkv.

    Plugin Author team-ok

    (@team-ok)

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Why the video support formart is less ?’ is closed to new replies.