Teaching, Technology and Tablet PCs…


Teaching, Technology and Tablet PCs…
Teaching, Technology and Tablet PCs…

MP4′s in Moodle…

Posted on July 20, 2009 by Andy Kemp

UPDATE: See update at the bottom

As MP4 seems to have become the default movie format in the last few years it has become more frustrating that moodle doesn’t natively support MP4′s!

The multimedia filter in moodle uses JW Viewer as the player for flv’s but the most recent version of this player now supports playing MP4′s!  So I figured I would have a go at updating the filter to support MP4′s (and M4V’s) using the latest version of JW Viewer

Well it turned out to not be that complicated…  I haven’t done a complete tidy up, but it seems to work as you would expect and means that students don’t need to have Quicktime installed on the client machine to play back MP4′s

To install this (very BETA) version of the plugin, simply download the attached file, unzip and upload the folder to replace the /filter/mediaplugin folder.  Then click on the “notifications” link to udate the settings…

The just upload the mp4/m4v file to your moodle install and put a link to it (as normal) and it should get replaced with the JW viewer…

Note: If you are using this for comercial purposes then you need to purchase a license from Longtail Video

Please let me know if it works for you!


UPDATE: It occoured to me that rather than hacking the core multimedia fiter it might work better if I just wrote a new filter just to deal with MP4/M4V files so that this would continue to work through upgrades etc…  So attached below is the all new (beta!) MP4 Filter

Download the MP4/M4V Filter

Download the original Mutimedia Filter <- May be useful if you downloaded my original attempt!

To install just download and extract the mp4filter folder and copy it to the filter folder, then make sure you remember to activate the filter!!

  • http://www.moodleblog.org Mary

    I tested it – and it works! Thanks very muchThis would be great for our school as I’m often presented with mp4s -however we are reliant on our broadband suppliers who host our moodle and therefore cannot add updates ourselves – it would be great to hope that in the next version of Moodle it comes as standard.

  • minhtam

    Sounds good. maybe you should add this to the Moodle Tracker?

  • http://moodle.org Martin

    Cool! Glad you could scratch that itch!

    I’d love to just include your changes and the new plugin in Moodle but we can’t, because the player uses this license http://creativecommons.org/licenses/by-nc-sa/3.0/ which forbids commercial use and is thus incompatible with Moodle’s GPL license which does not prevent people from using Moodle for commercial purposes.

    More on http://tracker.moodle.org/browse/MDL-18658

  • Andy Kemp

    Thanks Martin,
    I wondered if that might be the case…

    To that end I have split it off into a seperate plugin which I can then distribute seperately… Am I allowed to add it to the plugins directory if it is incompatible with GPL?

  • http://www.shrfirstresponders.ca Darcy Parker

    Hmmm- I got the filter installed, and I am putting the videos in the moodledata directory, the video player comes up but it says it cannot find the video or access denied.

    Am I putting the videos in the wrong directory (moddledata is blocked for direct access from web) or it is a folder permissions issue?
    [shrfradmin@p3nlhssl020 1]$ ls -al
    total 135080
    drwxr-x— 2 shrfradmin inetuser 4096 Aug 13 10:08 .
    drwxr-x— 11 shrfradmin inetuser 4096 Aug 13 13:19 ..
    -rw-r–r– 1 shrfradmin inetuser 137990820 Jul 10 18:03 PAIN_MANAGEMENT_PREVIEW.mp4
    -rw-r–r– 1 shrfradmin inetuser 35199 Jul 10 01:03 pain_management.JPG

  • http://www.shrfirstresponders.ca Darcy Parker

    OK, Got it working fine now – Bad src line.

    When I was using this player before I installed it as a filter, I could specify an image (jpg) that would be displayed as a video cover, Can this still be done now that I have it installed as a filter?


  • Andy Kemp

    Sorry Darcy, this version of the filter is basically just an adaptation of the current Media Filter to allow for MP4′s and as the previous version didn’t support ‘covers’ this one doesn’t either… If I have time to add it in I’ll let you know, but it is unlikely to happen in the near future.

  • Bruce Webster

    Thanks for this. In Moodle 1.9.6 the mediaplugin filter will handle mp4s (code without GUI setting form already in the weeklies). BUT, it uses quicktime.
    Makes sense since quicktime can play *any* mp4, but I do prefer to stick to just flash.

    I made 2 mods to your filter.
    1) Changed pattern so it only embeds if you have ?fp in the link GET string — making it an opt-in for those who know what kind of mp4 is acceptable.
    2) Added 19 pixels to height:
    $height = (empty($link[4]) ? 360 : $link[4]) + 19; // add controller height

    Your dimensions shrank the video slightly to add the controller – resulting in pillarbox bars and slightly degraded quality.

  • http://moodle.mrgundrum.com Scott Gundrum

    Is anyone else having issues with the video not playing? I get audio streaming with this filter, but no video.

  • http://moodle.mrgundrum.com Scott Gundrum

    I am having an issue with the videos streaming. The audio works fine, but the video is a black screen. I have no idea what could be happening, and was hoping for a little help if possible


  • Jing-Dong

    Does the mp4filter work in moodle 1.9.7 ?
    I have tried,but it don’t work, thanks

  • http://www.musapp.com Clarence

    Hello, I installed your media player plugin on my Moodle site. It works great.

    However, because you are using the JW Player, I kept looking for another solution. I found this Open Source flv-flash-fullscreen-video-player at:


    I was able to make it work using an iFrame on a Moodle Lesson page. It plays mp4 files very well.

    I wonder if you could use this Open Source player instead of the JW Player in your media player Moodle plugin? This might be just what the Moodle community needs.


  • http://www.etech.com/electronics-mp4-players--c1202_1293 Touch Screen Mp4 Player

    I would like to thank you for sharing this great information with us. I am really glad to learn about this because it helps me to increase my knowledge.

  • Alyson Stibbard

    Your filter worked first time. Thank you!

  • http://www.register-web-domain.in/ Domain registration India

    First off all i just wanted to say thank you for this great post and i really like every content of this post.

  • http://www.hosting-forum.in/ web hosting forum

    I am really glad to learn about this because it helps me to increase my knowledge. i am really glad to learn about this because it helps me to increase my knowledge.

  • http://viagracialisblog.com/ viagra blog

    hola good post about Moodle, for MP4

  • http://commercialloan-rates.com/ Commercial mortgage rate

    You really have a unique way to pen down your thoughts. It is mind blowing and so informative that no one can put their eyes off from your views. This is great achievement and great creativeness…
    I am visiting your site for a past one mont

  • http://jamesonwise.beep.com/ Seth Camacho

    The multi-media narrow in moodle uses JW Audience as the gamer for flv’s but the most latest edition of this gamer now facilitates enjoying MP4?s

  • http://carlossweet.webs.com/ Norman Ayers

    Moodle is a great technology designed to help teachers as well as students to have better interaction as well as to reach across the digital divide to enhance teaching and learning in any classroom in a simple and easy way.

blog comments powered by Disqus
  • About Me

    Andy Kemp is a husband, father, teacher, head of mathematics and all round tech enthusiast...
  • Search

  • Meta

  • Disclaimer

    The opinions expressed on this blog should in no way be taken to represent those of any organization for whom I currently or have previously worked. The content of comments are the responsibility of those who leave them.

↑ Top