New FLV filter available (contributed)

New FLV filter available (contributed)

by Julian Ridden -
Number of replies: 10
I have just creted and released an advanced FLV filter replacement adding new functionality to FLV embedding.

To use it you must first turn off the FLV option in the standard multimedia filter then enable this new filter instead.

Once installed, click on the filter settings and you can:
  • Set custom size
  • enable autostart or not
  • choose either to have the control bar float when you hover over the movie, stay at the bottom or be removed completely
The full screen functionality will now work properly as well. Click here to grab this filter from the Modules and Plugins database shortly.

Obviously, unless you need the added functionality, it is better to stay with the filter built into the core. For those wondering, this is using the same FLV player as in Moodle core, but just a new version of it.
Attachment flvplayer.jpg
Average of ratings: -
In reply to Julian Ridden

Re: New FLV filter available (contributed)

by Christophe Naud -
Hi Julian,
I have a few questions before I try your advanced filter which is really interesting me as I modified a few years ago the filter too and have no time for at the moment.

  • Have you tested it with different versions of Moodle ? (I'm using 1.8.5 and your screenshot seems different from mine)
  • I decompressed your archive and found no "new" flv player ? Is it normal ? (you say you're using a new version ot it in your post ?)
  • Are you talking about the general multimedia filter into Moodle which transforms links into automatic mp3, flv players or is it a different one ?
Thanks a lot,

Christophe
In reply to Christophe Naud

Re: New FLV filter available (contributed)

by Julian Ridden -
Mine will look different as it is a custom theme, and this filter interface has never existed before as I have only just built it smile

In the archive is a folder called flvplayer. That is the new filter with all the files inside it including the new player itself.

And yes, this is a replacement of the flv replacement aspect of the multimedia filter. Not a replacement of the whole multimedia filter though as it does not embedd any other media types except flv.
In reply to Julian Ridden

Re: New FLV filter available (contributed)

by Christophe Naud -
Might sound silly from me but I insist, when I decompress the archive I downloaded here http://moodleman.net/downloads/flvplayer.zip there is indeed into the flvplayer folder that :
README.txt
filterconfig.html
filter.php
defaultsettings.php
a directory : images with filmgrain.jpg and clapper.jpg
However there is NO new flvplayer file. I mean, to be precise, a new flash player file which would be called flvplayer.swf for example.
Is it normal ? anything forgotten while compressing this new filter ?
In reply to Christophe Naud

Re: New FLV filter available (contributed)

by Julian Ridden -
You are absolutely right and sometimes I am an idiot! ;)

I have attached the rong version. This one adds the extra functionality but still uses the existing flv player. I have updated the zip file with the correct one with the new player. I am very sorry for the confusion.


In reply to Julian Ridden

Re: New FLV filter available (contributed)

by Johnathan Kemp -

Hello Julian,

I was wondering, as you have been looking at the latest version of the flv player, if you have taken a look at the use of xml playlists. The flv player is insensitive to the file extension of the playlist file so in principle I think it should be possible to create a filter for files of type say .jwxml which could then be an xml playlist file.

Playlists enable the specifying of a series of flv files, so movies can be broken into sections, or several related movies can be included in one playlist. In addition playlists enable the specifying of close caption files and image files to be displayed at the start of the movie and in the playlist. In essence one flv file can only open one movie file without close captioning and without an opening graphic, but if there was a playlist filter then one xml playlist file could present to the student a number of flv files in a specified order.

I have been able to get playlists working in Moodle but only by creating a php file to call them, so it is something of a hack. I don't know much about php so the filter files are a bit of a challenge to me.

I have attached a screen shot of what a movie with playlist can appear like, for anyone who has not seen one. Note the images in my example are all the same but normally the image for each item on the playlist would be different.

I am willing to share the work I have done if there is anyone out there who fancies developing a filter for playlist files.

Regards

Johnathan

Attachment 28_moodlePic.jpg
In reply to Julian Ridden

Re: New FLV filter available (contributed)

by Daran Price -
Hi,
thanks for the plugin! I am having some issues with a bastardised filter.php combing yours with the original multimedia filter.php. It all works fine with your settings appearing at hte bottom of the multimedia settings page... However I am just trying to add a simple if file_exist statement to check for unique preview image files

$flv_url = addslashes_js($link[1]);
$image_string = $flv_url;
$new_image_string = substr($image_string,28,-3);
$flv_image_string = $new_image_string.'jpg';

if (file_exists($CFG->wwwroot.$flv_image_string)){
$image = $CFG->wwwroot.$flv_image_string;
}else{
$image = $CFG->wwwroot.'/filter/flvplayer/images/'.$image_default.'.jpg';
}

This is just to see if there is a jpg image with the same name and in the same directory as the flv file. The issue is the file_exists statement will not work!! When I echo $CFG->wwwroot.$flv_image_string it come ups with the correct url but the if statement does not see it.
Are you aware of where I might be going wrong? Any help would be greatly appreciated.

Kindest Regards Daran
In reply to Daran Price

Re: New FLV filter available (contributed)

by Daran Price -
Hi, regarding my last post - I have managed to find a way to check for individual preview images as below. This is a hacked version of Julian's new flash player filter and the original mediaplugin. The reason for hacking them together was to still be able to indicate image size within a flv link but still have the great attributes of Julian's filter.
The resultant hack now checks for a preview image with the same name and location as the flv file and uses that instead of the default one if it exists. The hack seems a bit convoluted tho - within the if file_exists statement it would only check for $CFG->dataroot string and then use a $CFG->wwwroot string!? I am not sure how efficient this is so if anyone can make it more sucinct please let me know. Heres the hack...

function mediaplugin_flv_callback($link) {
global $CFG;

static $count = 0;
$count++;
$id = 'filter_flv_'.time().$count; //we need something unique because it might be stored in text cache

$controlbar = $CFG->mediaplugin_flvplayer_controlbar;
$autostart = $CFG->mediaplugin_flvplayer_autostart;
$width = empty($link[3]) ? '480' : $link[3];
$height = empty($link[4]) ? '360' : $link[4];
$image_default = $CFG->filter_flvplayer_image;
$flv_url = addslashes_js($link[1]);
$image_string = $flv_url;
$new_image_string = substr($image_string,37,-3);
$flv_image_string = $new_image_string.'jpg';
$previewImage = $CFG->dataroot.$flv_image_string;
$flv_image_string = $CFG->wwwroot.'/file.php/'.$flv_image_string;

if (file_exists($previewImage)){
$image = $flv_image_string;
}else{
$image = $CFG->wwwroot.'/filter/flvplayer/images/'.$image_default.'.jpg';
}

return $link[0].
'<span class="mediaplugin mediaplugin_flv" id="'.$id.'"></span>
<embed
src="'.$CFG->wwwroot.'/filter/mediaplugin/flvplayer.swf"
width="'.$width.'"
height="'.$height.'"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="file='.$flv_url.'&controlbar='.$controlbar.'&autostart='.$autostart.'&image='.$image.'"
/>';

Kindest Regards Daran
In reply to Julian Ridden

Re: New FLV filter available (contributed)

by Lael ... -
When trying to change settings for this block on a 1.9.4 test install I am receiving a couple of errors. I don't receive the same errors on my 1.9.3 production install.

I am receiving the following php error:

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in C:\webserver\htdocs\moodle\lib\accesslib.php on line 3851

The offending line is this: return array_key_exists($capabilityname, $capsnames);

As a result - when attempting to change the settings for the filter I receive an access denied.

Lael
In reply to Lael ...

Re: New FLV filter available (contributed)

by Andres Garcia -
Hi, I have the same problem with moodle 1.9.4

when I tray to config this FLV filter this mensage apears

Access denied!!!

This error is encountered if you do not have admin privileges or if you are not logged in. This means that you are not authorized to enter such an area or run such scripts.

I'm sure I can accses to this file becose I have configurated to 777, but this problem stills.


Please If you have found the solution help me.
In reply to Julian Ridden

Re: New FLV filter available (contributed)

by Christophe Naud -

Hi Julian,

The download link to your advanced flv filter seems done. Any chance you provide the right link?

Thanks in advance.

Christophe