Lightbox link


#1

Hi
I’d rally like to have the activity video thumbnails link directly to the lightbox. How can I achieve this. As a feature request this would be a great option but I really need help if possible to create this functionality NOW.

Many many thanks

Danny


#2

@siteshack, You can achieve the same via some javascript tweaks if you are familiar with javascript. You just need to wrap the video container with tag. Somewhat like this, var href = jQuery('.media-type-video .rtmedia-item-title a').attr('href'); jQuery('.media-type-video .rtmedia-item-thumbnail').wrap('');


#3

Sorry but in what file would I apply this?

Many thanks Danny


#4

@siteshack, you can use that code in js file which is used by theme.


#5

Hi Ritesh

I put the code in /wp-content/plugins/buddypress-media/app/assets/js. But no effect.

` /* Showing hidden comments - pause for half a second */ if (target.parent().hasClass('show-all')) { target.parent().addClass('loading');

            setTimeout(function() {  
                target.parent().parent().children('li').fadeIn(200, function() {  
                    target.parent().remove();  
                });  
            }, 600);  

            return false;  
        }  
    });  

}  

jQuery('.rtmedia-item-thumbnail a').magnificPopup({type: 'ajax'});  
var href = jQuery('.media-type-video .rtmedia-item-title a').attr('href');  
jQuery('.media-type-video .rtmedia-item-thumbnail').wrap('');  

} });`

PLease advise Thanks


#6

@siteshack, that code was just an idea how you can achieve the solution and use the code in your theme's javascript file not in plugin files. It will flushed after new update. use this code, jQuery('.media-type-video .rtmedia-item-thumbnail').each( function(){ jQuery(this).wrap(''); });


#7

Hi Ritesh

I'm obviously being very stupid but the js folder for the theme contains many files and I have tried a few to no effect see js folder image attached. Can I add a js folder and file to the child theme folder?

And so I have not misled you the Lightbox image is what I am hoping to achieve. Click the video thumb nail and go to lightbox

Many Thanks

Danny

Attachment Link(s):

https://rtcamp.com/wp-content/uploads/rtMedia/topics/61978/2014/03/js-folder.jpg

https://rtcamp.com/wp-content/uploads/rtMedia/topics/61978/2014/03/Lightbox.jpg


#8

I think I've sorted it now many thanks

Real great help

Thank you Ritesh

Danny


#9

Slight Issue that the on page video plays under the lightbox so you 2 playing at the same time !! :-)


#10

Use this code for that issue, jQuery('.media-type-video .rtmedia-item-thumbnail').each( function(){ jQuery(this).wrap(''); }); jQuery('.media-type-video').click(function(){ jQuery(this).find('video').each(function() { jQuery(this)[0].player.pause(); }); });


#11

Really great thanks Ritesh. The only thing left is autoplay in lightbox is that acievable

Many many thanks

Danny


#12

Tried adding $("#video_player")[0].autoplay = true;

but didn't work

:-)


#13

Hi Ritesh

Do you have any thoughts on Lightbox autoplay or have I exhausted you :-)

Many thanks

Danny


#14

Hi Ritesh

Sorry got a bit of a problem PLEASE USE THE LATEST VIDEO Jilkminggan Portraits with image of man

The video does not seem to play from lightbox at

http://sharingdevsites.info/ssrebuild/members/lizthompson/ OR

http://sharingdevsites.info/ssrebuild/stories/

But does from lightbox at

http://sharingdevsites.info/ssrebuild/members/lizthompson/media/video/

That is it plays from the media gallery but not the activity pages.

Its definitely something to do with the code as when I take it off then then the video plays straight way in the lightbox when I press play.

/* rt-lightbox-link */

jQuery('.media-type-video .rtmedia-item-thumbnail').each( function(){ jQuery(this).wrap(''); }); jQuery('.media-type-video').click(function(){ jQuery(this).find('video').each(function() { jQuery(this)[0].player.pause(); }); });

Sorry

Thanks


#15

@siteshack, the video in activity stream(id:112) is not the same in the video tab(id:113). They both are different.


#16

Thanks for that - thought I was going mad !!

Last couple of questions

The thumbnails are they automatically generated or do you have to manually apply the FFMPEG generate button after each upload? If so is there an update coming that will auto generate a thumbnail and you can choose between the three if you need to change it?

The autoplay on lightbox select?

Ritesh I can't thank you enough for you help

Danny :-)


#17

No there seems to be a problem. You change the thumbnail and the video doen't play in the activity but does in the media gallery again. Presumably creating the thumbnail alters the id !!


#18

ids are the same actually. Something weird going on!!! The video is just not loading on the activity pages but is on the media gallery pages. The loading bar reflects this as in the media gallery it turns blue


#19

@siteshack, try uploading new video and then check. Regarding FFMPEG, it automatically generates thumbnails.


#20

I TRIED THAT. I'LL TRY AGAIN