General help

Moodle 2.3.1 Hacking FlowPlayer to play MP4

 
Picture of S Moodle
Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

Ok, Moodle 2.2.x can be hacked by adding mp4 to mediafilter,

But Moodle 2.3.x changed the entire media filter.  I think you just hack the filelib.php  and change the        

'mp4'  => array ('type'=>'video/mp4', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'),

to

'mp4'  => array ('type'=>'video/x-flv', 'icon'=>'flash', 'groups'=>array('video','web_video'), 'string'=>'video'),


Hoping this doesn't mess too many things up.  Very few people use a browser that does HTML5 correctly and flash video players work MUCH better for your average user.

 
Average of ratings: Useful (1)
Picture of S Moodle
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

Ok, the above hack was incorrect. 

To get flowplayer to play mp4's instead of quicktime, you need to make small edits to medialib.php in the lib folder.

Simply search for get_supported_extensions and remove mp4 from the quick time method, and add it to the get_supported_extensions for the flowplayer method.

Works great!  Now students don't need to download quicktime which requires administrative permissions on Windows 7.  Flash is so much better because you don't nee admin permissions to install it. 

Got the information from http://docs.moodle.org/dev/Media_embedding

 
Average of ratings: -
Picture of Will Taylor
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

changed again in Moodle 2.4 -

there is no longer a medialib.php file in the /lib directory;
so the hack of changing the .mp4 designation in the get_supported_extensions instances in this file is no longer an option :^(

has anyone found documentation of how this could now be handled in Moodle v. 2.4 ?  my .mp4 files are now playing in QT by default & I cannot figure out how to play these in FlowPlayer as I had them configured in 2.3

(I know I could rename these files .flv and link as such, but there must be a way to reconfigure the media filter to direct .mp4s to FlowPlayer, as there was in Moodle v. 2.3)

 
Average of ratings: -
Picture of Andrew Norton
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

For future readers: This currently works in Moodle 2.5+.

 
Average of ratings: -
Picture of Isabelle Langeveld
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

Dear all,

I just updated to 2.5.1, hoping problems with uploading video from iPad or iPhone in for example a Workshop submission and playing it in FF, IE or Chrome without having to download Quicktime would be solved, because Flowplayer recognizes the format (i-devices spit out MOV) and selects a player. I am probably misunderstanding something here, or do I need to change some settings?

TNX,

Isabelle

 
Average of ratings: -
Picture of S Moodle
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

Dear all,

I just updated to 2.5.1, hoping problems with uploading video from iPad or iPhone in for example a Workshop submission and playing it in FF, IE or Chrome without having to download Quicktime would be solved, because Flowplayer recognizes the format (i-devices spit out MOV) and selects a player. I am probably misunderstanding something here, or do I need to change some settings?

TNX,

Isabelle

iDevices capture movies in MP4 format, which is native to HTML5.  If you use the newest browers, they won't need QuickTime.  The whole point of HTML5 was to avoid having people need QuickTime/Realplayer/Flash.  Moodle 2.5's media plugin supports HTML5.  You just need to make sure you are using ie10.

 
Average of ratings: -
Picture of Isabelle Langeveld
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

TNX, I will try this out. I don't think it is too much to ask from your participants to install the newest browser, don't you think? Only if they want to work on the course on their company network you will engage problems. We know organisations still on IE7...

 
Average of ratings: -
Picture of Lars-Olav Tuff
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

I think there is no need for a hack of the moodle files. Just rename the file from *.mp4 to *.flv, and upload. As long as the file is encoded as mp4 video with aac audio, this should work, since both of these format are native to flv files.

I know this won't work with linking files in from other sites, only those you upload yourself.

mp4 files encoded with Handbrake - acc stereo, works. Just rename them *.flv before inserting into moodle.

Best regards, larstuff

 
Average of ratings: Useful (3)
Picture of S Moodle
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

I think there is no need for a hack of the moodle files. Just rename the file from *.mp4 to *.flv, and upload. As long as the file is encoded as mp4 video with aac audio, this should work, since both of these format are native to flv files.

Lars, you are correct! Nice tip! big grin I didn't know FlowPlayer is smart enough because the FLV format is a different wrapper for the aac/264 contents.  That's great to not have to deal with that.

Reasons I don't like the HTML5 player compared to FlowPlayer

  1. Everyone has Flash on their browsers.
  2. Flash is easy to install and doesn't need admin permissions on Windows
  3. Most people are still not using HTML5 browsers.
  4. Quicktime needs admin permissions to install.
  5. HTML5 doesn't show a loading screen.  FlowPlayer does.
 
Average of ratings: -
Picture of Ruslan Kabalin
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
Core developersPlugin developers

> 1. Everyone has Flash on their browsers.

Just for the info, you can't play flash on iPad/iPhone, you can't play flash on new Android devices without hacks (Adobe no longer maintains Flash for Android), Adobe itself changes priorities to HTML5. Though flash is nice and easy (at least when you do not have many players on the same page), it might be scrapped in the future.

 
Average of ratings: -
Picture of Rick Jerz
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
Particularly helpful Moodlers

I use a "best of both world's" approach.  My videos are MP4's.  I bundle these into a RSS feed (a podcast feed), and then have my Flash Player read and display the feed in my custom video player, and I have Moodle read the feed and display links to the videos.

Computer users have no problem using Flash from their browsers.  The iPad (+) users can click on the RSS feed link in Moodle, and these videos "stream" to the iPad.  Of course, it iDevice users can also subscribe to the feed in iTunes.

With my method, I have reached almost every user and device.  I am not sure about Blackberry users, nor Windows Mobile users.  In my attached graphic, I provide a screenshot showing my Flash player (which is in its separate browser window) on the left, and the RSS feed in Moodle on the right.


 
Average of ratings: -
Just wondering . . .
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
Particularly helpful Moodlers

Why can't we play MP4 videos using flowplayer without

  1. a hack as described above or
  2. changing extensions?

Moodle 2.3.2+ (Build: 20120927)

Am I missing something?

-Derek

 
Average of ratings: -
Just wondering . . .
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
Particularly helpful Moodlers

This is sometimes such a busy forum it is difficult to keep up with the posts.  This question had just slipped off the first page and was over a week old.

Is there an answer to this? 

-Derek

 
Average of ratings: -
Just wondering . . .
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4 [solv-ed I beleive]
Particularly helpful Moodlers

In using Moodle sometimes I just live with things for a while, kind of naively believing some problems will sort themselves out as time goes on and people pick off a few more tracker items and we upgrade.  Last week I was tinkering with this video question again (and grumbling a little) with this.  I think I have a solution.

I did not understand part of the Admin Media embedding settings.  In some semi-random act I switched OFF this item:

I believe that switching this off means that Moodle decides Flowplayer will play the uploaded MP4 videos.

If this is true, I'll set up a tracker item to make the help a little clearer and complete the FAQ in the docs here: http://docs.moodle.org/22/en/Media_FAQ#I_have_an_MP4_file._How_can_I_play_it_in_Moodle.27s_player.3F

If this is true, it means we have a nice simple solution, where you can merely upload amost any kind of video clip as a file, and click the link and it will play (nicely) in Flowplayer.  No more complex label > embed code etc to get things nice.  (I think that's cool)

Have a nice day.

-Derek

 
Average of ratings: Useful (2)
Picture of Tim Allen
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4 [solv-ed I beleive]
 

I tested this (unticking mp4 for Quicktime) on Moodle 2.3.1 and it's not working for me.  I had to rename the file extenstion as suggested above, which did work.

However, this presents a problem.  My server has limited space, and I would like to avoid having multiple formats for each video.  I would like to standardise on mp4 files, but if I keep the extension mp4, flowplayer doesn't work, while if I use *.flv HTML 5 will not work.  The former breaks older non-HTML 5 browsers, while the latter breaks apple idevices.

My workaround was to create an alias with an extension of flv pointing to the mp4 file.  This played in flowplayer as an flv and in HTML 5 as an mp4, and I only had to upload one video file format.

 
Average of ratings: -
Just wondering . . .
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4 [solv-ed I beleive]
Particularly helpful Moodlers

OK Tim, I am not sure what is going on.

I have tinkered with a few settings here and there on our Moodle, and it's had a point upgrade, and now this what I described has stopped working.

I have just checked out demo.moodle.net.  Switch Quicktime OFF in the Admin, upload an MP4 and it does play in Flowplayer by default with no change in the File settings.

-Derek

 
Average of ratings: -
Picture of Rainer Schaufelberger
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

Hi

I hoped that someone could bring some light into that darkness, but nothing happed so far.

Then I decided to have a look at that medialip.php file. I managed that Moodle now does not ask to install that Quicktime plugin. But I can't find the flowplayer methode to add .mp4. Therefore Moodle now only shows a link instead of the embeded video.

Any help?

Thanks, Rainer

 
Average of ratings: -
Just wondering . . .
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
Particularly helpful Moodlers

Finally added a tracker item for this:

https://tracker.moodle.org/browse/MDL-36769

Maybe you'd like to vote.

-Derek

 
Average of ratings: -
Picture of Justin Hunt
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
Particularly helpful MoodlersPlugin developers

In PoodLL we use the flowplayer to play .mp4s . It is trivial, and I am not quite sure why its not working out of the box in core.

Anyway a hack is hack, and every time you upgrade Moodle your hack will get overwritten. So one option, until mp4 works out of the box in core, would be to install the poodll filter and check "handle mp4" in the PoodLL filter settings. Then the flowplayer that bundles with PoodLL will be used to play your mp4 files.

 

 
Average of ratings: -
Picture of John Gifford
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

Thanks Justin

That's the solution I've setup for one of our ICT teachers whose used some captivate videos in mp4 format. According to her she's actually getting kids engaging in the class who haven't engaged in the past. I heard one student using it and he said "it's like watching youtube as a lesson".

One problem I've been having though is every so often the page that I put the poodll player onto just doesn't show anything. It could be our moodle server or the age of the client machines (1GB RAM Dell Optiplex with XP) at fault but some of the students have been getting a "done with errors" message on the page which comes down to 'line 75 character 2 lz is undefined?' I looked at the code and can't find anything referring to lz around line 75.
If I update the page and remove the <p></p> tags that the TinyMce editor wraps around the poodll code it will work again.

Any thoughts?

 
Average of ratings: -
Picture of Justin Hunt
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
Particularly helpful MoodlersPlugin developers

Hi John

If the video shows up sometimes but not at other times, the most likely cause of this is Moodle caching. Try  this...

Go to: Site Administration -> Plugins -> Filters ->Common Filter Settings
There set “Text Cache Lifetime” to “no.”

(I have changed the way we embed things so that this is not such a problem. But I have not properly tested that yet.)

If the video never ever shows, then something else is the culprit.

 
Average of ratings: -
Picture of John Gifford
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

Thanks Justin, I've just looked on our server and the cache was set to one minute (the default value) I've now set it to No and let the teacher know, so she's going to try it tomorrow. As a way of trying to get around this problem I've redone the extension on her mp4 videos to flv as well so that they can play through flowplayer. Performance isn't great but it does seem to provide her with an alternative delivery method, which she told me has helped today. But I'd rather not duplicate files like that if I can get away with it...but needs must!

I'm even looking at a separate 'Darwin' streaming server to try and stream the video files from, if more teachers consider video tutorials then it might be worth considering. But i've got a feeling I run into the original problem of the students needing quicktime installed to be able to use the videos.

 
Average of ratings: -
Picture of Justin Hunt
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
Particularly helpful MoodlersPlugin developers

Right, well lets hope the cache tweak fixes it.

Setting up a streaming server is an option I guess, but there are more manageable options available these days. You would probably be best to look at using a video services provider like kaltura or ensemble (just heard about them) or even YouTube.  

However in the short term I think the MP4 problem can be sorted out pretty easily. If you need me to login and snoop around, just let me know.

 
Average of ratings: -
Picture of haytham fathey
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

Ok, Moodle 2.2.x can be hacked by adding mp4 to mediafilter,

But Moodle 2.3.x changed the entire media filter.  I think you just hack the filelib.php  and change the        

'mp4'  => array ('type'=>'video/mp4', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'),

to

'mp4'  => array ('type'=>'video/x-flv', 'icon'=>'flash', 'groups'=>array('video','web_video'), 'string'=>'video'),


Hoping this doesn't mess too many things up.  Very few people use a browser that does HTML5 correctly and flash video players work MUCH better for your average user.

 
Average of ratings: -
Picture of Philipp Pavelka
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

http://docs.moodle.org/dev/Media_embedding

This suggests editing medialib.php. 

Removing .mp4 from the get_supported_extensions() function in the core_media_player_qt class and adding it to the coresponding class in core_media_player_flv should do the trick. 

Not sure whether the adaptation to filelib.php is a better choice.

 
Average of ratings: -
Picture of Rob Johnson
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
Particularly helpful Moodlers

Removing .mp4 from the Quicktime function and adding it to those played by Flowplayer is how my 2.3.3 site is set up.  Flowplayer falls back to HTML 5 for tablets.  It works like a charm.

 
Average of ratings: -
Picture of Jared Reed
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

Where is this done at? Within the code itself or somewhere in Moodle administration? Either way, can you please specify more in depth how to do this? Thank you smile.

 
Average of ratings: -
Picture of Rob Johnson
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
Particularly helpful Moodlers

@Jared,

This is done in the Moodle code.  Open /lib/medialib.php.  Add 'mp4' to the file types played in the core media player.  In my 2.3.3 site it is line 720.  You will see flv and f4v listed there.

Remove 'mp4' from the file types played by Quicktime.  This is line 862 in my installation.

Please post back if you have further questions.

 
Average of ratings: -
Picture of John Gifford
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

Just spoke to the teacher today and she says that

"Moodle is behaving itself"

I turned off the cache, I'm using a mod_deflate setup that I saw  for Apache (that compresses the pages and content making the content transfer smaller). She's also got alternate video links for flv versions of her videos that go through flowplayer. Flowplayer seems to have problems with the fact you can't resize the video it plays in all available space, whilst the in-popup option isn't a player it downloads the file and then tries to open whatever flash player the user has installed.

 
Average of ratings: -
Picture of Isabelle Langeveld
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

I uploaded my mp4 as an .flv and now Flowplayer plays in the page, even in an Lesson, but like you say here, the window splays all over the page. Does anyone know where to resize the player to say 640/480? Do I have to type some html code in the page? Or can I do it in one go for all flowplayer instances?

 
Average of ratings: -
Picture of Rob Johnson
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
Particularly helpful Moodlers

It defaults to the actual size of the clip.  If you edit the HTML, add ?d=640x480 to the end of the href section of the code.

 
Average of ratings: -
Picture of John Gifford
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

additionally Justin the students don't have access to youtube inside the school. I don't know about the accessibility of the other services you mention. But it appears to be working at least nominally. I can look at better solutions later.

 
Average of ratings: -
Picture of Justin Hunt
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
Particularly helpful MoodlersPlugin developers

Snap. My students don't have access to YouTube either. The dedicated "pay for" services probably are not blocked. We would have to try and see  though.

I think that filter caching thing was the culprit. I really will have to figure out how to get around that.

 
Average of ratings: -
Picture of Pamela Dooley
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

You can upload your videos to teachertube.com, it probably isn't blocked and it is free.

 
Average of ratings: -
Picture of S Moodle
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

You can upload your videos to teachertube.com, it probably isn't blocked and it is free.

Yeah, but sometimes I don't want the entire world to have access to my videos. So it's much easier to simply change the extension from .mp4 to .flv.  No hacks are needed for Moodle 2.x

 
Average of ratings: -
Picture of Isabelle Langeveld
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

Dear all,

I am working on a site that is on 2.6. I can not get an mp4 to play in a Lesson. And I can not show an mp4 as a video in a label. In a Label I can only show a link and if I click on that a new window opens and there the video starts to play. Of course this is not what you want!

In this discussion I see a few times that the problem of not being able to play mp4 with Flowplayer is solved in 2.5, but it is not. I can only get an mpv to play in the Lesson if I copy the file and save it with the flv extension.

 
Average of ratings: Useful (1)
Picture of Hittesh Ahuja
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
Plugin developersTesters

Same here. On Moodle 2.6.3, If i uncheck Use Quick time under Media Embedding, on Firefox, it displays the video as a hyperlink.

Mp4 support in Moodle 2.6
Browser Player type Result
Firefox 27.0.1 Flowplayer 
Not Supported - Displays a hyperlink to the video file instead
Firefox 27.0.1 Quicktime  Supported - Plays the file in Quicktime player
Chrome 35 Quicktime / Flowplayer
Supported - Plays mp4 in a HTML5 player
Internet Explorer 11 FlowPlayer Supported - Plays the file in an HTML5 player ( surprised!)
Internet Explorer 11
Quicktime Supported - Plays the file in Quicktime player

Tested under Windows 7 .

Regards,
Hittesh
 
Average of ratings: -
Picture of Sébastien Petit
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

I have the same problem... Moodle 2.7.

 
Average of ratings: -
Picture of Ken St. John
Re: Moodle 2.3.1 Hacking FlowPlayer to play MP4
 

changing the extension of an mp4 video file to flv still won't work on iDevices - they see the flv extension and object loudly, right?

 
Average of ratings: -