Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1341073

    Hi there,
    I think this might fall into a category of suggestion vs. a support request unless there is a way to do this with the current Enfold video element.
    Here’s what I want when page loads on desktop:

    – Video starts playing muted (as required by all the major browsers now)
    – When there is user interaction (ideally user clicks a play button super imposed over the video) the video un-mutes and starts over again

    It appears with the video element, the video does start playing muted but when the user clicks, the sound does not start and instead, the user must find the volume control which is more obvious on Youtube hosted videos than Vimeo. Ideally, if the user clicks anywhere on the video it should immediately un-mute.

    One workaround if we cannot modify the hosted video players (Youtube, Vimeo) would be to allow a video preview image which we could upload to the media library with no sound. Then when the user clicks “play” the video launches in a lightbox.

    Currently here is my page… I have reverted to using the lightbox option as it seems to be the only option where a user is likely to be able to hear the video:

    I have pasted another version of this page in private content.. this version has the muted video autoplay so you can see how cumbersome it is for the user to try to find the dash marks that make up the volume control on Vimeo.

    Given the importance of video these days, it would be great to have an option that allows a user to go from muted video that autoplays (in compliance with Chrome browser requirements) to un-muted upon user interaction.

    Hope this makes sense.

    Thanks,
    Rob

    #1342074

    Hey Rob,

    Thanks for reaching out to us and sorry for the late reply.

    In this case, I would have recommended the route you already took on your testimonials page. I am not sure if that is even possible for YouTube and Vimeo videos but I will forward your request to our devs. I also have to mention that this is the first time we have received this request so I am afraid it would have a lower priority.

    I will add the link of this thread as reference and we will update you regarding your request here :)

    Best regards,
    Yigit

    #1342078

    Thank you for your response, Yigit. Many of the larger sites are taking a “mobile first, video second” approach to design (according to friends who work in the tech industry here in SF) and I think in the next few years it will be very common for us to see muted videos on both desktop and mobile that unmute when they are clicked or there’s another user interaction. Another way to approach this would be to show the video preview (video wallpaper) and then launch video playing in lightbox after a user clicks.

    Thanks much.

    Best,
    Rob

    #1342240

    Hey!

    Thank you for the info.

    For the meantime, you can try this script in the functions.php file to unmute a playing video on user interaction and restart it. It might require a bit of adjustments such as checking if the clicked element is the actual play button and not the video controls but it should work just fine. Please note that the script will set the volume of the video to 0.5 but it can be adjusted directly in the script.

    function ava_custom_script_mod(){
      ?>
      <script>
            (function($) {
    			// unmute videos on user interaction
    			$(document).ready(function() {
    				var video = $(".avia-video");
    
    				video.on("click", function() {
    					var vid = $(this).find(".mejs-mediaelement").find("video").get(0);
    
    					vid.pause();
    					vid.currentTime = 0;
    					vid.muted = false;
    					vid.volume = 0.5
    
    					setTimeout(function() {
    						vid.play();
    					}, 200); 
    				});
    			});
    		})(jQuery);
      </script>
      <?php
    }
    add_action('wp_footer', 'ava_custom_script_mod');
    

    You can adjust this line to increase or decrease the volume.

    vid.volume = 0.5
    

    All you need to do now is insert a play button above the muted video and remove the button on restart or on user interaction.

    Regards,
    Ismael

    #1342307

    Hi Ismael, thank you so much!
    I tried this on my staging site and it doesn’t appear to be working… link in private content.

    Best
    Rob

    #1342511

    Hi,

    Looks like you are using Vimeo. Please note that the script above will only work on a self hosted mp4 video or an html5 video element. For vimeo, you will have to use this SDK.

    // https://developer.vimeo.com/player/sdk/reference#about-player-methods

    Best regards,
    Ismael

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.