Moodle 2 video sizing and flowplayer / jwplayer

Moodle 2 video sizing and flowplayer / jwplayer

by Lael ... -
Number of replies: 9

I'm looking at upgrading our version of Moodle to Moodle 2 from 1.9. In 1.9 we are using the mediaplayer module to allow easy and effective control of video sizing and playback.

In Moodle 2 the mediaplayer module has not been ported so I looked at how effective the inbuilt filters are.

From what I can tell - there are issues (not Moodle's fault) with cross-browser compatibility for using HTML5 as the standard filter. I was testing using mp4/m4v/f4v as the container for an h264 video. Using mp4/m4v ie handles html5 fine, firefox does not (looks like a grey box with an x in it).

If HTML5 is off the default is quicktime if it exists, which does not allow fullscreening. If using a flash container (f4v), it works well cross browser, loading in flowplayer. However, the player loads the video at full size, which in my test exceeded the available space.

Three questions:

1. Is it possible to make mp4, m4v load by default through flowplayer? seems like they are supported formats on flowplayer's site.

2. How is the default size of the flowplayer set? It would be ideal to allow it to be set by the 'teacher' as per the ?800x600 parameter used with the old flash player. Setting one size that is known to work with the theme would also be fine, as the 'student' can select fullscreen.

3. Is it possible to replace (not in core, but as a 'hack') the flowplayer with jwplayer?

Thanks,

Lael

Average of ratings: -
In reply to Lael ...

Re: Moodle 2 video sizing and flowplayer / jwplayer

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

 Hi again. In answer to number 2, take a look at question 2 in the Media FAQ http://docs.moodle.org/22/en/Media_FAQ

In reply to Mary Cooch

Re: Moodle 2 video sizing and flowplayer / jwplayer

by Lael ... -

Hi Mary, Thanks for your help.

I didn't locate that one when I was looking. Great to see ?d=400x300 seems to work for any video on a page. (tested on an mp4 as well as a f4v).

I was hoping to be able to change the dimensions for a file as well though, as I imagine with the drag and drop upload block that will be most teacher's preferred (simple and fast) way of adding resources. Any ideas? think I might try looking in the flowplayer config files. Do you know if it is loading a file does it still refer through the filter plugin code?

In reply to Lael ...

Re: Moodle 2 video sizing and flowplayer / jwplayer

by Vinay Khosla -

Hi there,

"?d=400x300" doesn't seem to work for me nor does "#d=400x300". The video still comes up in horizontal scroll bars. I tried making some changes in the /filter/mediaplugin/'filter.php' file, changed the height & width options under the "filter_mediaplugin_flv_callback($link)" FUNCTION, but still no change came up on the screen.

Can you help me through this problem? I want to shrink the container's dimentions.

Regards,

Vinay

In reply to Vinay Khosla

Re: Moodle 2 video sizing and flowplayer / jwplayer

by Lael ... -

Hi Vinay,

I'm assuming you are talking about moodle2 using the default media filter?

If so you need to edit the html to put the size of the video in after the filename you've linked to.

If you want to permanently change the size for your whole site - look at 2. in the post below

In reply to Vinay Khosla

Re: Moodle 2 video sizing and flowplayer / jwplayer

by Imtiaz Ahmed -

Hi there, if you are talking about the size of media player shown on the site then "?d=400x300" works fine. At least for me it works!

 

In reply to Lael ...

Re: Moodle 2 video sizing and flowplayer / jwplayer

by Lael ... -

ok, so some answers in case anyone else is looking for them as well...

1. yes - in mediaplugin/filter flash section of the filter (lines 131-133) place |m4v|mp4 after the flv|f4v - works fine, though loads much more slowly than jwplayer.

2. in mediaplugin/filter the sizes are set on line 38 and 47. but you need to change $autosize on line 564 to false (set after width and height are set from lines 38 and 47). old setting of ?d=widthxheight works as Mary stated. New version is ?#=widthxheight

3. Yes - though I haven't figured out how to replace flowplayer or where size is controlled when flash files are directly linked to rather than embedded in a page (which is ideally what I would like to do -help? - as I think the mimetype icons are actually really useful, and it would allow drag and drop video creation for mp4).

I took Andy Kemp's mp4filter and updated it with the latest version of jwplayer, added a language string, skin, and changed some settings. Turn off flash filtering and mp4 filtering in the mediaplugin filter to prevent double embeds. does not work with ?# method of specifying the width and height. I assume the regex could be updated but I don't understand it yet.

http://moodle.wcc.nsw.edu.au/jwplayerfilter.zip

works with 1.9 and 2.2

Average of ratings: Useful (1)
In reply to Lael ...

Re: Moodle 2 video sizing and flowplayer / jwplayer

by Sam Mudle -

1. yes - in mediaplugin/filter flash section of the filter (lines 131-133) place |m4v|mp4 after the flv|f4v - works fine, though loads much more slowly than jwplayer.

Well, I don't see a speed difference here.  I'm glad that mp4 works with flowplayer. 

I had a problem getting mp4's to be rendered with HTML5 (Mime type problems), and I don't want students with older browsers to have to chase down Quicktime which requires Administrator permissions.


About your regex problems, yeah I just created a filter for java applet files.  The preg_replace php functions are bizare (well, php is pretty wacko language compared to Java).  I've found that this site really helps with php specific regex and moodle filters: http://www.spaweditor.com/scripts/regex/

In reply to Lael ...

Re: Moodle 2 video sizing and flowplayer / jwplayer

by Derek Chirnside -

Lael, and Mary.

I'm back having a look at this issue of media deployment after a break.  Up until August last year I never found a good solution with Out of the Box Moodle 2.0+ (ie without some hacks) to have media work

  • simply and well
  • with predictable results
  • quickly (I didn't want to have to write special code for anything like sizes of a video clip etc)

The problem is complex and involves all sorts of issues.  I just want super quick upload/link and deploy a video with scrubber etc without worrying about resolutions, screen sizes etc etc

This week I noticed this tracker request: http://tracker.moodle.org/browse/MDL-29624 which is LONG, with lots of detail.  I'm not entirely sure I am happy with all the aspects - it seems to be saying this will make it easier for the problems to be fixed (or customised) without hacking the core - rather than actually providing a robust solution in core Moodle.

Voting on the tracker item probably won't change anything, but it may give you a small glow of satisfaction for a milisecond.

-Derek

In reply to Lael ...

Re: Moodle 2 video sizing and flowplayer / jwplayer

by Lael ... -

OK, pretty happy actually!

Hacked 1.9 to embed links to flv, f4v, mp4, m4v, mov through JWPlayer. Details attached via the text doc. Haven't looked at 2.0 yet.

Any comments / suggestions are welcome!

Lael