New plugin: Streaming media filter (RTMP) - filter_rtmp

New plugin: Streaming media filter (RTMP) - filter_rtmp

by Fred Woolard -
Number of replies: 12

The streaming media filter is an extension of the Moodle core_media_renderer (filter, renderer, player) module. It looks for any anchor href values that begin with 'rtmp://' and substitues the necessary html span tag with attributes to be used by a corresponding javascript module.

The plugin's YUI module applies the flowplayer function, using Flowplayer's rtmp plugin, to the <span> elements with class values of 'filter_rtmp_audio', or 'filter_rtmp_video'.

The plugin downloads for Moodle 2.3 and 2.4 can be found here.

The source code can be found on here.

The Moodle Docs page can be found here.

Average of ratings: -
In reply to Fred Woolard

Re: New plugin: Streaming media filter (RTMP) - filter_rtmp

by Boris Puhanic -

Hi Fred,

I installed this filter, enabled it, and read the moodle docs, but I'm not sure how to get it to work.

I tried <a href='rtmp://streaming.server.address/oflaDemo/audio_file.mp3">Audio</a>

but the player doesn't get embedded and Firefox complains that it doesn't know what to do with an 'rtmp' link.

What do I need to do to make it work? Using Moodle 2.4.1.

Boris.

In reply to Boris Puhanic

Re: New plugin: Streaming media filter (RTMP) - filter_rtmp

by Fred Woolard -

Boris,


That the (fallback) link is being displayed means the JavaScript flowplayer() function failed on, or did not get called for that <span> tag. There could be several reasons.

I'll assume that JavaScript is enabled in your browser, and that the Adobe Flash plugin is installed and working. Use a tool such as Firebug, or if using IE the built-in developer tools. Verify that the module.js file from filter/rtmp/ is being loaded, as well as Flowplayer's library. If there are error messages in the script console after the page load, what are they?

After the page load, if you were to examine the page source (HTML), what does that <span> tag look like. Does it have the 'filter_rtmp_audio' class? Are the 'data-media-conx' and 'data-media-path' attributes properly populated?

Regards,
FW

In reply to Fred Woolard

Re: New plugin: Streaming media filter (RTMP) - filter_rtmp

by Boris Puhanic -

Hi Fred, I checked some of the things you mentioned, and it seems that module.js is not being loaded, and I didn't see the flowplayer library loaded either.

Is there something else I need to enable, or do I need to pre-load module.js in the head section?

The <span> tag in the source has all the things you mention, and they appear to be  populated with the correct values.

Thanks,

Boris.

In reply to Boris Puhanic

Re: New plugin: Streaming media filter (RTMP) - filter_rtmp

by Fred Woolard -

Boris,

The YUI loader is responsible for fetching the module.js file, and the Flowplayer lib if it has not already been loaded by the javascript-static.js file, so you should not need to load either in the head section.

Were there any JavaScript console error messages?

As a temporary measure, if you have filter caching turned on, disable it (Site administration->Plugins->Filters->Common filter settings), by setting Text cache lifetime to 'No'.

In Moodle 2.4, when the filter cache is off, the rtmp_filter's module.js file is loaded in the standard Moodle fashion using js_init_call(), and when viewing the page source, shortly after the START OF FOOTER comment, there should be an inline script that begins M.yui.add_module({"filter_rtmp" ...

Do you have any other media files (local repository) that you have successfully been able to play using the core mediaplugin filters? That is to say, have you been able to use Flowplayer elsewhere in Moodle?

Hope this helps in someway.

Regards,
FW

In reply to Fred Woolard

Re: New plugin: Streaming media filter (RTMP) - filter_rtmp

by Boris Puhanic -

Hi Fred,

I set the Text Cache filter to No.  The player appears, and I can see that file loads, but  appears to be somewhat quirky when I try to manipulate the controls. When I click play nothing seems to happen, although sometimes it looks like it's playing, but there's no sound.

In the Javascript info I can see the module.js and flowplayer library both loaded.

I'm not exactly sure how to check for Javascript errors, but there don't seem to be any (I am using Web Developer > Information > View Javascript, in Firefox).

Boris.

In reply to Boris Puhanic

Re: New plugin: Streaming media filter (RTMP) - filter_rtmp

by Fred Woolard -

Boris,

The quirkiness you describe may be an issue with Flowplayer's rtmp plugin and the particular media server you are using (which is what, by the way?). I have no experience with the internals of Flowplayer, its .swf file, or the Flash plugin.

As for the player appearing to play the stream, yet there being no sound, is the mute button appearing? Can you post a small screen shot of the rendered player?

Is the stream publicly accessible such that I can embed its URL in a page on my site? The mystery for me presently is why the player only appears when filter caching is turned off. What are the settings you have in Site administration->Appearance->AJAX & JavaScript?

Regards,

FW

In reply to Fred Woolard

Re: New plugin: Streaming media filter (RTMP) - filter_rtmp

by Boris Puhanic -

The server is Red5, and all the controls appear to be there, including the volume/mute button.

 

The URL is not entirely 'public', but I can give you access if you send me your IP address via a private message.  It would be good if you could check it out.

AJAX & Javascript settings are all at their default settings:

Enable AJAX: Yes; Use Online YUI Libraries: No; YUI Combo Loading: Yes; Cache Javascript: Yes; Activity Chooser Default: Yes.

Cheers,

Boris.

In reply to Boris Puhanic

Re: New plugin: Streaming media filter (RTMP) - filter_rtmp

by Fred Woolard -

Boris,

One other thing to double-check is that you have the correct version of the plugin for Moodle 2.4. The chief difference between the two is the version of the Flowplayer .swf and .js files (therefore the filenames) referenced.

When I visited the plugins db page, the default download presented was for 2.3 for some reason, so just making sure we haven't overlooked the obvious. This happened to be the problem another user had.

The module.js file for 2.4 should have these lines:

    _js_flowplayer: M.cfg.wwwroot + '/lib/flowplayer/flowplayer-3.2.11.min.js',
    _swf_cfg_base:  M.cfg.wwwroot + '/lib/flowplayer/flowplayer-3.2.14.swf',

 Where the 2.3 version will have these lines:

    _js_flowplayer: M.cfg.wwwroot + '/lib/flowplayer/flowplayer-3.2.8.min.js',
    _swf_cfg_base:  M.cfg.wwwroot + '/lib/flowplayer/flowplayer-3.2.9.swf',

If it is the case you have the wrong version installed, unintall the incorrect version, and install the correct one. There are differences in other files as well, so do not replace only the module.js file.

Regards,
FW

In reply to Fred Woolard

Re: New plugin: Streaming media filter (RTMP) - filter_rtmp

by Boris Puhanic -

It seems to be the right one.  It says I have 2013052002 installed.

In reply to Fred Woolard

Re: New plugin: Streaming media filter (RTMP) - filter_rtmp

by Doug Osborne -

I was just put in charge of a Moodle site, which I am trying to update from 1.9 to current. The site is mostly rtmp video, and long story short, your plugin has helped immensely in upgrading since Moodle no longer allows for the method we were using to pull in the jwplayer code.

Anyway, there is one catch... in the quiz sections, when an incorrect answer is submitted, we play a particular section of a video that pertains to that question. I can see how to program that into flowplayer with 'start' and 'duration' parameters, but can't quite figure out how to implement that in Moodle with your RTMP plugin. It's able to take the dimensions from a query string... is it possible to add 2 more query strings variables for start and duration? I think I am getting the gist of the code, but can't quite find where its looking for the query string. Any help you can offer is appreciated! Thank you!

In reply to Fred Woolard

Re: New plugin: Streaming media filter (RTMP) - filter_rtmp

by Fred Woolard -

Updated 06/14/2013: Corrected way additional query str params are handled. Added support for .f4v extension. Auto-detects the Flowplayer files version.