Any plugin/easy code to add a video as lightbox in homepage?

Hello everybody,

as in the subject I think it would be useful to many of us to show a video in homepage, possibly in a lightbox so that the design on the homepage itself does not need to be updated for each new video admins want to show.

What do you think? Is there any plugin for this or some code to add somewhere?

I searched in the community and nothing seems to exist, please pardon me if this is a duplicate discussion.

Cheers

 

  • I don't know about lightbox (I believe that it's works with images only) but we did it for each video file on any site page with another video plugin.

    All code need to override for icon/object/file or icon/object/video views.

    Here's an example that works for us:

     

    else if ($url && $type == "video") {
    $params = array(
            'href' => elgg_get_site_url(). "YOUR-PLUGIN-CODE-CALL",
            'title' => $title,
            'is_trusted' => true,
        );
        if (isset($vars['link_class'])) {
            $params['class'] = 'YOUR-PLUGIN-CLASS ' .$vars['link_class'];
        }
        echo elgg_view('output/url', $params);
    }

     

    You can try replace YOUR-PLUGIN-CLASS with lightbox, or similar

  • Hi RvR!

    Thank you so much for your suggestion which will hopefully be useful also to others. At the moment I have no idea of where your code has to be put...I'm not a developer :D but I'll try to figure it out

    Cheers!

    PS in the meanwhile I found something inyteresting, will see and report back if it works. It's here and under MIT licence

  • the videobox uses mootools which is a javascript library.. elgg already is loading the jquery js library and also a lightbox system (fancybox - i think)..
    so you could look at using that for efficiency.

    i would like to see this as the standard elgg lightbox device:
    http://www.jacklmoore.com/colorbox/

  • Hi ura soul,

    Yes, I read something about elgg already having those library and lightbox included so thought there could be an easy way to call them. I have placed a video in my testsite's homepage but had to change the design which I don't like at all so was wondering if by adding some code in the same homepage I could make the video 'popup' in a lightbox instead of embedding it in the homepage.

    Cheers

  • i just searched the elgg sourcode for the term 'box' and found some examples of lightboxes being used.
    e.g. iionly's beta of tidypics uses a lightbox when creating a new album.

    here's the code used there:

            elgg_load_js('lightbox');
            elgg_load_css('lightbox');
            $new_link = elgg_view('output/url', array(
                                  'href' => "ajax/view/photos/selectalbum/?owner_guid=" .$group->guid,
                                  'text' => elgg_echo("photos:addphotos"),
                                  'class' => 'elgg-lightbox',
                                  'is_trusted' => true,
                                 ));

    so maybe you could replace the 'href' with the embed code for the video or an elgg view that shows the video (such as is used by the videolist plugin) and then the text field would be the link text that will be clickable.. and then use 'echo' in php to output the results of that code.. and that should be all that's needed.

    this is all done via php..

    to do it without php would requires something along the lines of the videobox you linked already, yes.

  • @Michele   http://videobox-lb.sourceforge.net/ is interested but used 'mootools'. Too much js :(

    Use http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/ - simple'n'easy plugin for images and videos

    All what you need is an adding your-url-to-your-plugin-for-playing-video and your-link-class-for-calling-it

    All aboving codes are the popups. No more.

    Your video will be play into popup window similar as 'lightbox effect' ;)

    I have no idea of where your code has to be put

    As I said:

    need to override ... icon/object/file or icon/object/video views.

    Try and feedback :)

  • after some testing of that theory...
    i have gotten the built-in elgg lightbox to show images and internal elgg pages.. but not yet successfully show youtube embeds or some external pages.. i think that is possibly caused by cross-domain 'security' rules in javascript.. though i am not certain.

  • oh nice!
    1.9 elgg has colorbox built in. :)