Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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 hover

    I 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.
    #1011433

    Hey 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,
    Victoria

    #1011508

    Hi 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,
    Thomas

    #1011727

    Hi,

    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,
    Ismael

    #1011731

    Thank 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.

    #1012224

    Hi,

    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,
    Peter

    #1012723

    Hi 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,
    Thomas

    #1013352

    Hi,
    Great, glad you found a working solution :)

    Best regards,
    Peter

    #1013405

    Hi,

    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,
    Thomas

    #1013922

    Hi,

    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

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Video on hover for portfolio items’ is closed to new replies.