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:
653 sites
180 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

Comments

  • David Mudrák
    Thu, 26 Mar 2015, 1:27 AM
    Any chance for a nice screenshot please?
  • David Mudrák
    Thu, 26 Mar 2015, 1:42 AM
    Thanks Justin for yet another nice plugin shared with the community. It is nice to see how the ideas coming from your Generico filter evolve into new and vital spheres. I am happy to approve the plugin now. You are cleared to land now, welcome to the Plugins directory!
  • Justin Hunt
    Thu, 26 Mar 2015, 9:40 AM
    Thanks David. Boy that was the fastest approval yet. I will put up a screenshot or two shortly.
  • Brandon Rizzo
    Wed, 15 July 2015, 2:13 AM
    Is there a way to use subtitles with this plugin? I'm having a little trouble, I'd like to have mp4s handled by jwplayer and utilize subtitles.
  • Justin Hunt
    Wed, 15 July 2015, 9:07 AM
    If it is possible with jwplayer, then it should be possible with VideoEasy. I did set up flowplayer with subtitles for mp4. And I just put that on the demo site now, so that you can see how it was done. In that case I followed the info in the flowplayer docs to set up a video with subtitles using a .vtt file. Then I put the subtitle file in the same directory as the video with the same file name (but different extension). You can see all that at the PoodLL Demo site. Make sure that you log in as admin (creds on top page) so that you can see the template itself. http://demo.poodll.com/mod/page/view.php?id=190
  • Anderson Hsu
    Tue, 18 Aug 2015, 8:35 PM
    Dear support team,
    How do we know the version of video easy plugin which we used now? Because it can not run by using ie8 at winxp, it always show the message as listed as below : https://drive.google.com/file/d/0BxriXuT0xeaFUE9PQ2FLYkF3ZWc/view?usp=sharing
  • Justin Hunt
    Wed, 19 Aug 2015, 11:57 AM
    The version of the plugin can be seen on this page:
    [YOUR_MOODLE_URL]/admin/plugins.php?contribonly=1

    That error message relates to some javascript problem.
    IE 8 will sometimes have problems with modern javascript.
    I am not even sure it supports: console.log('Hello world')

    That error might come from the videoeasy's javascript, or it might come from the player you are trying to load.
    It looks like its coming from videoeasy's javascript. Try updating to the latest version of VideoEasy.
    If that doesn't fix it, I guess you will need me to look at it. But I am not very excited about trying to support IE8.
  • Anderson Hsu
    Wed, 19 Aug 2015, 7:46 PM
    After confirm with flowerplayer customer service, we also update flowplayer and video easy plugin, but the result is still the same. We face the problem of the error message : https://drive.google.com/file/d/0BxriXuT0xeaFYVJMVS0yWW0wM2s/view?usp=sharing . Would it be possible to give us other suggestion ? Thank you.
  • Justin Hunt
    Wed, 19 Aug 2015, 9:10 PM
    I suggest you find the line of code that is causing the error message. The error message just tells the file and char number, but I can' t really work with that. I also don't have IE8 and am not sure if it has debugging options. It is probably better for many reasons that you drop support for IE8 and encourage all involved to upgrade to another version or use a different browser. IE8 will have many more problems than this on modern sites.
  • Jeff White
    Wed, 2 Sept 2015, 1:41 AM
    How would one go about referencing a video Id from a video streaming service like brightcove? I am haivng trouble getting my filter to work by listing the video ID in a page.
  • Justin Hunt
    Wed, 2 Sept 2015, 9:48 AM
    Well. Which is better?
    i) pasting in a link to the video file in the moodle media dialog
    ii) manually linking a piece of text to the video file
    iii) entering the video id in a popup dialog from the Moodle html editor

    The first two are good use cases for videoeasy, ie you have the url to the video file. But if all you have is the ID, ie the third case, then the Generico filter might be a better option. The Generico filter is VideoEasy's big brother, and has its very own Atto editor icon for inserting things. You would make a "brightcove" template and then from the Atto editor click Generico , then click "brightcove," and enter the ID. The template would be largely just the embed code that brightcove gives you with the ID part turned into a variable (eg @@id@@ ). See here for the Generico filter: https://moodle.org/plugins/view/filter_generico
  • Jeff White
    Sat, 5 Sept 2015, 1:51 AM
    Thank you Justin! I completely overlooked that plugin. I will give it a shot.
  • Pascal Brunet
    Mon, 5 Oct 2015, 8:05 PM
    Hello, I found a bug with 1.1.2. If Iuse more than 1 video in the same block, I only see the first video. And if I have links after my video, it's the same. When rendering, the links are hidden.
  • Justin Hunt
    Wed, 7 Oct 2015, 1:15 PM
    Hi Pascal. That does sound like a bug indeed. Though its likely its a problem with template itself. The key point then is, what is the template? ie what player? If you switch to a different player, is the problem resolved?
  • Martina Schn
    Wed, 7 Oct 2015, 9:21 PM
    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.
Please login to post comments