Integration / API Print E-mail

As a Joomla extension programmer you know, that content plugins are only invoked for regular content. To get around that limitation, AllVideos Reloaded provides a special event type, named onAvReloadedGetVideo. So in order to embed the functionality of AllVideos Reloaded into your own extension it just needs a few lines of additional code:

$output = '';
if (JPluginHelper::importPlugin('content', 'avreloaded')) {
    $app = &JFactory::getApplication();
    $res = $app->triggerEvent('onAvReloadedGetVideo', array($mediacode));
    if (is_array($res) && (count($res) == 1)) {
        $output = $res[0];

In the above code, $mediacode is the string, containing the media tag(s) and $output is the result of the plugin's invocation. Now, nothing can stop you from spicing up your extension with media displays provided by AllVideos Reloaded!

New: As of version 1.2, this API is not needed anymore!

AllVideos Reloaded 1.2 comes with a little system plugin, which invokes AllVideos Reloaded globally. Therefore, AllVideos Reloaded now works in any foreign component like VirtueMart or from within a custom module. Even if no content plugins are invoked.

Last Updated ( Wednesday, 02 July 2008 21:42 )