• 1. I have placed a button “Let’s Go”
    2. I have placed a video form relation with Vimeo
    3. Wanna play the video when chick button called “Let’s Go” using JavaScript

    Do you have any idea?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • I was looking for something similar in a button that would stop the video before closing a modal window. While I ended up using innerHTML to effectively erase the video link, Charles L posted code for controlling the video.

    Copied from stop-pause-video-when-modal-is-closed-not-using-sign

    var video = document.createElement("video");
    video.setAttribute("src", "nameOfFile.ogg");
    

    Then you can do something like:

    
    video.pause();
     video.currentTime = 0;
    
    From w3Schools:
    
    var vid = document.getElementById("myVideo"); 
    
    function playVid() { 
        vid.play(); 
    } 
    
    function pauseVid() { 
        vid.pause(); 
    }
    

    You can then call these functions from inside your closing/open modal functions

    • This reply was modified 5 years, 5 months ago by jolanxbl. Reason: cleaning
    Thread Starter wordpresser757

    (@wordpresser757)

    @jolanxbl Thanks for your reply.

    I have followed this solution. But it doesn’t work.
    I think I need to find the video form element using JavaScript instead of to create a new element. But I can’t find that video element using the WordPress Elementor. That is why I posted this issue.

    Do you have any idea?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Control Video (Play, Stop) when click a external button’ is closed to new replies.