Video Easy Filter

Filters ::: filter_videoeasy
Maintained by Justin Hunt
VideoEasy is a filter to play mp4, mp3 and other media files with html5 players. It uses user editable templates to allow the admin to customize the appearance of existing players or to support new players. Predefined player templates support Video JS, JPlayer, JW Player, Flowplayer and MediaElement.js
Latest release:
602 sites
181 downloads
42 fans
Current versions available: 5

VideoEasy  replaces links to media files, with  html5 players. Primarily intended for html 5 video, it will also work for audio, youtube or rss links. The Video Easy filter uses templates to support multiple players, and allows the user to add new players or customize existing ones, all from the Video Easy filter settings pages. By default players are already defined, and can be used as is, for:

Video.js, JPlayer, JW Player, Flowplayer and MediaElement.js

But preset templates are available for other players, and you are encouraged to use the existing players and presets as examples, and make your own templates.

NB Questions and comments should be posted in the Video Easy forum thread.
https://moodle.org/mod/forum/discuss.php?d=382047

Installation

The easiest way to install is to use Moodle's automated plugin installer. However if you are uploading videoeasy via FTP, first expand the zip file and upload the videoeasy folder into:

[PATH TO MOODLE]/filters.


Then visit your Moodle server's Site Administration -> Notifications page. Moodle will guide you through the installation. On the final page of the installation you will be able to register templates. Since there are 15 template slots available, and each has a lot of fields. It is not practically possible to get much done here.  So ..... Just scroll to the bottom and press "save." 

After this each template has its own settings page. It is much easier to work with the settings that way. After installing you will need to enable the videoeasy filter. You can enable the videoeasy filter when you visit:

Site Administration / plugins / filters / manage filters

Finally you will need to associate a player/template with each of the file extensions, and select the file extensions that VideoEasy should handle. You can add/remove/edit the file extensions that VideoEasy can parse for, on the same page.

Do this at: Site Administration / plugins / filters / VideoEasy / General Settings

(NB JW Player requires you to register on their site, and you will be given a license code. You will need to enter that into the template for those players. See "Templates" in this document.)


Configuration

Configure the site wide settings  and define/edit templates at 

Site Administration / plugins / filters / Video Easy


On the general settings page you need to check the filetypes you wish the Video Easy filter to handle at the top of the settings page, and select the player template(drop down list) that will handle that file extension.


NB You should TURN OFF file handling for any extensions you select here in the Moodle Multi Media Plugins filter, and the PoodLL filter if they are installed.

Multi Media Plugins filter settings can be found at:

Site Administration / appearance / media embedding


PoodLL filter settings can be found at:

Site Administration / plugins / filters / PoodLL


Local Configuration

One of the strengths of Video Easy is that it makes use of the under utilized Moodle feature that allows you to configure filters at the course and at the activity level. Using this, for example, it is possible to display videos in a particular page using a different template/player to that used elsewhere. This would make it possible to make a page with 100 videos embedded, behave differently to a page with just a single video.

The rest of this document gets a bit technical. From here its not strictly necessary to read on.  

You might just watch this quick 5 minute introduction to VideoEasy.


Templates

There are several templates available to use. The first six are ready made, though they can be altered.They are: Video.js, JW Player, Flowplayer, MediaElement.js, and Youtube lightbox.


JW Player requires that you register with their site to get a personal javascript link. So you will need to do that first then enter it in the defaults field of the template before you can use them.

Each template has several fields, but only the name/key field is required:

1) required javascript url : The url of the JS file the html5 player requires.

2) required css url : The url of the CSS file the html5 player requires.

3) AMD : True or False. Since Moodle 2.9 certain libraries are loaded using Require.js. If the player library supports it, you will need to set this to true. Currently only VideoJS and JPlayer use this. 

4) Shim exports: For players that do not support AMD, but which you need to load with AMD you should specify here the name of the global object that they export. Then AMD will do fancy stuff to load it for you. And you can use the exported name in the load script.

5) template : The html that goes on the page. Often this is just a div , with a unique id. Sometimes it is html5 video tags.

6) load script : Any script which the player runs to load an individual player, usually with the unique id of a container div

7) defaults : Custom variables you may use in the template or load script, or default values for existing variables (ie width and height).

8) custom css: CSS that you need on the page, that can be edited here on the settings page.

9) upload css: It is possible to upload a CSS file for inclusion on the page. This is probably in the case that the file is not available online to be be simply linked to. 

10) upload js: It is possible to upload a JS file for inclusion on the page. This is probably in the case that the file is not available online to be be simply linked to. 

11) shim exports. As for 4) but with regards the uploaded js


Presets

Each template's page contains a drop down with a number of "preset" templates. (template templates ..I guess).  Using these you can quickly make new templates, or use as a starting point for your own template. The current presets are:

Video.js, JW Player, Flowplayer, MediaElement.js,Youtube Lightbox

In order to keep VideoEasy small, there are no actual JS players bundled. Flowplayer, JPlayer etc are all included on the page via CDN hosting sources. In some cases, it will work better if you have those players installed on your own web server. Notably if they have a flash fallback that has flash components, which are sensitive to crossdomain hosting issues. 


The Video Easy Variables

Variables are used to replace placeholders in the template and load scripts. A placeholder for a variable looks like this: @@VARIABLE@@ (variable name surrounded by @@ marks.)


These variables are generated by Video Easy after parsing the media link on the Moodle page. You can define your own in the defaults section if you wish. 

NB Video Easy supports the ?d=[width]x[height] notation that Moodle's multi media plugins filter uses, for all extensions, but not for Youtube links. But since almost nobody ever uses it, in most cases you will want to specify a width and height in the defaults section for the template. The variables WIDTH and HEIGHT are populated with the values from the url param when d=[width]x[height] is set.

Video Easy also supports passing in variable values via the video url. So if the url of the video was :

h.ttp://somewhere.com/video.mp4?color=green&subtitles=no

The template could access the variables "color" and "subtitles" and they would contain the values "green" and "no."


VideoEasy provides the following ready made variables for use in your template:

AUTOMIME = video file mime type determined by file extension.

FILENAME = filename of video

AUTOPNGFILENAME = the video filename but with a png extension

AUTOJPGFILENAME = the video filename but with a jpg extension

VIDEOURL = the url of the video

URLSTUB = the url of the video minus the file extension. 

AUTOPOSTERURLJPG = the full video url but with a jpg extension

AUTOPOSTERURLPNG = the full video url but with a png extension

DEFAULTPOSTERURL = url to a default poster image. VideoEasy ships with  bland grey image. But you can upload your own default poster image on the Video Easy general settings page.

TITLE = the video title (from linked text)

AUTOID = an auto generated id to use in the container div or elsewhere

CSSLINK = used internally to load a CSS file if needed.

PLAYER = the type of player (videojs, flowplayer ...etc)

WIDTH = the width of video

HEIGHT = the height of video

FILEEXT = the video file extension

COURSEID = the id of the current course

COURSECONTEXTID = the id of the current course context

Note that while the template replacement is a simple swap out of the placeholder text, the loader script replacement is a little different. The loader script replacement will remove surrounding quotes as well as the placeholder, and put a JS variable in their place.

 eg

 template: <video id="@@AUTOID@@" 

 becomes: <video id="123456"

 

 loader script: player{ id: "@@AUTOID@@"

 becomes: player{ id: opts['AUTOID']

 

And a final caution, Video Easy generates a loader script from the template (if required) but this will be cached by Moodle in most cases. Thats a good thing too. But it means you will need to run Moodle "purge all caches" after making changes to anything on the Video Easy filter settings page.

NB Questions and comments should be posted in the Video Easy forum thread.
https://moodle.org/mod/forum/discuss.php?d=382047



Enjoy

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4
Screenshot #5
Screenshot #6
Screenshot #7

Contributors

Justin Hunt (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

コメントを表示する
  • Anne-Sophie Cabrillat
    2016年 11月 22日(火) 17:18
    Hi Justin. I installed VideoEasy on Moodle 3.0
    I'm working on a Moodle test in which the users could clic on a word (or on a symbol next to the word) and listen to this word pronunciation. I have difficulties to configure the templates. I need to configure my audioplayer in order to get a very simple "play icon" and volume level with a maximum witdh 30px. Wich template you think I should use ? How can I resize it ? Thanks a lot.
  • Marko Marko
    2017年 01月 25日(水) 08:26
    After installing it, the only option that I have on settings under File Extension Handlers is Flowplayer First Frame...?
  • Gianluca Torbidone
    2017年 06月 16日(金) 03:04
    Hi Justin,
    do someone know if I would use 2 or more javascript files for the player? There are players version that need more javascript files.
    Thanks
  • David Heuring
    2017年 12月 22日(金) 14:31
    Oh boy... I just upgraded to Moodle 3.4+. Everything was great. I decided to add some file extensions to the videoeasy filter. So when I went to save I got the error messages in the attached file. Most importantly, I am no longer able to open the "Site Administration" link in the Admin block. I'm basically locked out, although I can still edit the Frontpage and course settings. Just can't get into "Site Administration". I figured it was due to adding these two file extensions to the filter so I went to the database and deleted the fields for the two file extensions I had just added to the filter. Same outcome. I am unable to open the "Site Administrator".

    Thanks for any advice.

    Dave

    Error Message

    Invalid admin setting (filter_videoeasy/handle ACC)
    Debug info:
    Error code: invalidadminsettingname
    Stack trace:
    line 1701 of /lib/adminlib.php: moodle_exception thrown
    line 1567 of /lib/adminlib.php: call to admin_setting->parse_setting_name()
    line 2643 of /lib/adminlib.php: call to admin_setting->__construct()
    line 94 of /filter/videoeasy/settings.php: call to admin_setting_configcheckbox->__construct()
    line 88 of /lib/classes/plugininfo/filter.php: call to include()
    line 215 of /admin/settings/plugins.php: call to core\plugininfo\filter->load_settings()
    line 8000 of /lib/adminlib.php: call to require()
    line 7885 of /lib/adminlib.php: call to admin_get_root()
    line 10 of /admin/blocks.php: call to admin_externalpage_setup()
    Invalid admin setting (filter_videoeasy/handle ACC)
    Debug info:
    Error code: invalidadminsettingname
    Stack trace:
    line 1701 of /lib/adminlib.php: moodle_exception thrown
    line 1567 of /lib/adminlib.php: call to admin_setting->parse_setting_name()
    line 2643 of /lib/adminlib.php: call to admin_setting->__construct()
    line 94 of /filter/videoeasy/settings.php: call to admin_setting_configcheckbox->__construct()
    line 88 of /lib/classes/plugininfo/filter.php: call to include()
    line 215 of /admin/settings/plugins.php: call to core\plugininfo\filter->load_settings()
    line 8000 of /lib/adminlib.php: call to require()
    line 4163 of /lib/navigationlib.php: call to admin_get_root()
    line 4026 of /lib/navigationlib.php: call to settings_navigation->load_administration_settings()
    line 759 of /lib/pagelib.php: call to settings_navigation->initialise()
    line 820 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav()
    line 136 of /blocks/settings/block_settings.php: call to moodle_page->__get()
    line 288 of /blocks/moodleblock.class.php: call to block_settings->get_content()
    line 230 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
    line 1210 of /lib/blocklib.php: call to block_base->get_content_for_output()
    line 1262 of /lib/blocklib.php: call to block_manager->create_block_contents()
    line 579 of /lib/outputrenderers.php: call to block_manager->ensure_content_created()
    line 39 of /theme/bootstrapbase/renderers/core_renderer.php: call to core_renderer->standard_head_html()
    line 16 of /theme/gourmet/layout/columns2.php: call to theme_bootstrapbase_core_renderer->standard_head_html()
    line 1261 of /lib/outputrenderers.php: call to include()
    line 1191 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
    line 2790 of /lib/outputrenderers.php: call to core_renderer->header()
    line 374 of /lib/setuplib.php: call to core_renderer->fatal_error()
    line ? of unknownfile: call to default_exception_handler()
  • David Heuring
    2017年 12月 26日(火) 10:32
    Okay, I fixed it this way. First, I moved the videoeasy folder out of the Moodle directory on the server. Doing so made it possible to get to "Site Administration" again without getting the above error message. I then navigated to the "Manage Filters"page. Next, I needed to move the videoeasy folder back to the Moodle Filters directory on the server. On the "Manage Filters" page, I disabled and then uninstalled videoeasy (also cleared cache). At that point, videoeasy was no longer in the database or residing in the Moodle directory so as a final step, I re-installed a clean copy of videoeasy and re-configured all the settings again.

    Seems to be working properly again, but what I did originally that caused the error and inability to access the "Site Administration" link.
  • David Heuring
    2017年 12月 26日(火) 12:53
    Last word on this. I think I know what caused this. It's quite possible I mistakenly used a period (.) instead of a comman (,) when adding new extensions in General Settings. I already had acc as a file type and this happened when I tried to add ACC. I thought the duplicate caused the problem but that is not the case as I was just able to do it with the "fixed" version. This leads me to believe I used a period and not a comma. That's the only thing that makes sense.
  • Farney Jiménez
    2018年 03月 15日(木) 04:37
    Hi Justin, thanks for this post.

    I would like know if with this plugin can I implement interactive video transcript?

    if yes, how i do it?

    This is an example of what I am looking for:

    https://www.3playmedia.com/solutions/features/plugins/interactive-transcript/

    Best regards,
  • Sanat Sharma
    2018年 03月 22日(木) 04:44
    Hi, I am trying to use this filter however, whenever I add a video url, the default moodle videojs plays the video. I have followed all the instructions detailed in the above post. What could be the reason for such behavior? I am currently using Moodle 3.4.1. I have disabled Multimedia plugins filter as well as have checkmarked mp3 and mp4 files to be played with the FlowPlayer First Frame default template.
  • Gery Pen
    2019年 02月 5日(火) 19:40
    Hi! I have the same problem as Pascal. If I add more than one sound (I use mp3 files), only the first one is showing. If I add second file after the first one, it's not showing it or any other content after that sound. I don't think it's the problem with the template because I've tried all of them, even made a custom one, and the result is the same.
  • Justin Hunt
    2019年 02月 5日(火) 21:14
    To handle questions and comments better from now on please post in the Video Easy forum thread:
    https://moodle.org/mod/forum/discuss.php?d=382047
  • mario gharib
    2019年 06月 17日(月) 03:11
    Hi! I succeed to let an audio be played only one time during an exam (4 pages);
    However, is there a way to force the audio to be played till the end before going to next page? Thanks
  • Justin Hunt
    2019年 06月 17日(月) 16:26
    Mario, not really. From within a quiz question it is not easy to control page navigation. It can be done with javascript enabling and disabling buttons on the page. And I have done this in the past. But its a bit fiddly.
  • Michelle Jay
    2019年 10月 30日(水) 06:45
    Hello, we have been using your plugin for several months now - thank you very much for providing such a flexible plugin! We have recently created a global glossary on our site that uses videos within the definitions. Unfortunately, these videos don't seem to be using the Video Easy Filter and instead the default Moodle player. I have checked to make sure the filter is active in the glossary, but the videos in the glossary are still not using the filter. Is there something I'm missing? Does Video Easy not work within a glossary? I appreciate your help!
  • Alexander Lebeth
    2020年 03月 25日(水) 21:55
    Hello, I just wanted to make a template, that uses most recent video.js files. But if I use "//vjs.zencdn.net/7.5.5/video.js" and "//vjs.zencdn.net/7.5.5/video-js.css" as CDN, then the player isn't invoked. What's happening here? Moodle version is 3.5.
  • mario gharib
    2022年 04月 11日(月) 19:41
    Hello,

    I managed to use VideoEasy filter successfully. However, if I use Safe Exam Browser, it doesn't work.

    Any idea how to solve this issue ?

    Thank you.
1 2 3 4 5
Please login to post comments