Customize players / mini-once player?

Customize players / mini-once player?

by CCLB Administrator -
Number of replies: 5

Hi - is there a way to customize:

  • the text shown on the onceplayer (i.e. change it to French?)
  • colors, buttons, etc.


Also, is there already a mini-once-player?  I could use that in the meantime as there is no text to deal with...


Also also, while I'm asking, is a once-video-player an option or something that might be in the future?


These would be useful options for tests where the user is only allowed to view content once before answering questions.  (Yes, I realize that they can just refresh the page in many cases, but these options would be a step in the right direction.)

Average of ratings: -
In reply to CCLB Administrator

Re: Customize players / mini-once player?

by Justin Hunt -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Great questions Jeremy. 

I am aware of the need for much more functionality for the players. I have to hang my head and say that for the most part they won't do what you ask. My current plan is to redo the PoodLL players to use a completely different filter I have developed, that makes customizing them much easier. This is the video easy filter. But I will probably create a specific audio player version.

If the language strings for the Once Player were customizable, would that be sufficient for now?

In reply to Justin Hunt

Re: Customize players / mini-once player?

by CCLB Administrator -

Indeed, moodle-filter_videoeasy looks far more powerful at first glance than the video player in poodll...  Do you have plans to incorporate the "Play Once" functionality somehow?

I don't want you to pursue this issue with Poodll if it is your intention to make the media players obsolete.  I'd rather see you work on videoeasy and make it the best darn media filter available.  ;)

In the meantime, I have hacked together a solution for videos using jQuery that manipulates the HTML video object - it basically auto-plays the video, hides the controls and disables right-click functionality.  This still doesn't address page refreshes, but I believe the only way to track that is to have the user's current playhead location saved to the database somehow every few seconds.  (I have implemented this kind of functionality on another non-Moodle site in the past and it works nicely... but I digress.)  The solution may lie in the ability to add custom JavaScript to your new 'templates'.

For the audio-only playonce scenarios I am using Mat Bury's old .swf file and manually crafting the <object> tags in the content.  Not elegant, but it's working and no text strings to deal with...

In reply to CCLB Administrator

Re: Customize players / mini-once player?

by Justin Hunt -
Picture of Particularly helpful Moodlers Picture of Plugin developers

yes "play once" comes up quite often, but it never seems worth as much trouble as it would take to develop the full implementation.

For the once player I was planning on just implementing some custom controls for the HTML5 player. I would make a "onceaudio" VideoEasy template, and then that could be set as the player that handled MP3 in the context of that activity. 

It might even be more appropriate to make the template using the "Generico Filter" because then we wouldn't have to worry about owning the mp3 file extension.

Hmmm, actually if you could share the code for the once player for video , I could at least make that one up in Generico. It would be a good starting point for the onceaudio player.

What do you think? 

In reply to Justin Hunt

Re: Customize players / mini-once player?

by CCLB Administrator -

Taking this code a step further to create custom controls would be pretty easy.  A simple "Play" HTML  button below or overlayed on top of the video could be customized by the user to say whatever they need, in whatever language.

Here is the jQuery code I used.  It is not robust, in that it will take away the controls from every <video> object on the page and start playing them, but it is simple enough to modify the selector if there are multiple videos on the page, for example.


First, the video is linked using Moodle's <A> method, and the default media filter converts it to a <video> tag.

<a href="http://player.vimeo.com/external/VIDEO_ID.mp4?s=f586954a8dbb3f76de13aa">My Video</a>

Insert this code in the HTML editor immediately after the video to remove the controls and begin playback:

<script type="text/javascript">// <![CDATA[
$("video").prop("controls", false); // hide the controls
  $("video").get(0).play(); // play the video
  $("video").bind('contextmenu', function(e) { return false; }); // disable right-click
// ]]></script>


In reply to CCLB Administrator

Re: Customize players / mini-once player?

by Justin Hunt -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Thanks lets me have a go at my end and see what I come up.