-
AuthorPosts
-
September 18, 2018 at 5:30 pm #1011412
Hi dear Kriesi team!
I am searching for a solution since 8 hours . I’ve bought several plugins, tested the code of this thread: https://kriesi.at/support/topic/video-on-hover/ (it works fine!) and finally I am hoping that you can help me.
What I try to get is something like this: https://animade.tv/studio (or http://rossching.com/)
– image Overlay (Text)
– link to portfolio entry
– video play on hoverI want to show some portfolio entries with the masonry element.
Why masonry and no code elements for each portfolio entry? – it should be easy for my customer to manage the content of the site on his own.
I hope you can help me.
Chers,
Thomas- This topic was modified 6 years, 3 months ago by Ink_Eye.
September 18, 2018 at 5:59 pm #1011433Hey Ink_Eye,
Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)
Best regards,
VictoriaSeptember 18, 2018 at 9:18 pm #1011508Hi Victoria,
unfortunately I feared that.
Is there a workaround? Is is possible to do it with the image or video element? For Example: To display six posts I would work with six video elements and link them to the portfolio entries.
Maybe something like in https://kriesi.at/support/topic/video-on-hover/ with the video element.Chers,
ThomasSeptember 19, 2018 at 11:05 am #1011727Hi,
Are you going to use mp4 videos on your site? This script might work for the portfolio grid but you have to add the videos as the portfolio items’ external url.
Add this in the functions.php file:
add_action('wp_footer', 'ava_custom_portfolio_video', 9999); function ava_custom_portfolio_video(){ ?> <script type="text/javascript"> (function($) { $('.grid-entry').each( function(e) { var entry = $(this); var link = entry.find('.grid-image'); var poster = link.find('img'); var video = '<video class="w-100 grid-video" loop="" preload="true" controls="false" muted=""><source src="'+link.attr("href")+'" type="video/mp4"></video>'; $(video).appendTo(entry); var video = entry.find('video'); $(this).hover( hoverVideo, hideVideo ); function hoverVideo(e) { video.get(0).play(); link.css('z-index', '1'); } function hideVideo(e) { video.get(0).pause(); link.css('z-index', '3'); } }); $('.grid-video', 'body').avia_html5_activation({ratio:'16:9'}); })(jQuery); </script> <?php }
And then use this on the Quick CSS field:
.grid-video .mejs-controls, .grid-video .mejs-button, .grid-video .mejs-overlay-button { display: none !important; } .grid-video { position: absolute; top: 0; width: 100% !important; height: 100% !important; z-index: 2; } .grid-video video { object-fit: cover !important; }
NOTE: This is not going to work for youtube or vimeo videos.
Best regards,
IsmaelSeptember 19, 2018 at 11:22 am #1011731Thank you Ismael for your work!
Yes, self hosted mp4 videos. External URL means, when the customer klicks on the item, the link goes to the video?
Meanwhile I worked with the code of the older thread, see private content below. I think visualy this is an elegant solution.
September 20, 2018 at 11:53 am #1012224Hi,
Yes in the “Additional Portfolio Settings” section of the portfolio editor page select “Define custom link” from the dropdown and insert your video url into the “Link portfolio item to external URL” text field.
Best regards,
PeterSeptember 21, 2018 at 11:56 am #1012723Hi Dude, hi Ismael,
thank you for your help! I really appreciate it.
I tested it, pls see link below. I do not know what I’m doing wrong. I worked on the other solution today (see link below). I think I will go with this. For the customer it’s not that easy to customize, but it gives me more possibilities in the customization.
I think I will use your Code in the future, when we add more video content to the site.
Nevertheless you all helped me very much. Like every time I write in this forum.
Best regards,
ThomasSeptember 23, 2018 at 4:53 pm #1013352Hi,
Great, glad you found a working solution :)Best regards,
PeterSeptember 23, 2018 at 8:18 pm #1013405Hi,
yes, I’m very happy with the solution. What I can’t figure out is, that sometimes only 4 of 6 videos are displayed/loaded. Sometimes all.
Best regards,
ThomasSeptember 25, 2018 at 12:01 am #1013922Hi,
Glad we could help!
Please take a moment to review our theme and show your support https://themeforest.net/downloads
Don’t forget to bookmark Enfold Documentation for future reference.Thank you for using Enfold :)
Best regards,
Basilis -
AuthorPosts
- The topic ‘Video on hover for portfolio items’ is closed to new replies.