Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #48357
    dragonstar0828
    Participant

    I need to load and play different videos via a url when the user clicks different buttons.

    Support told me I could do this in Javascript w/o any problem as it’s an html5 player under the hood for self hosted videos.

    I dropped a Video Box on my Elementor page and set it’s ID to “video1” and added this Javascript (simple single button example)…
    ================================================
    <script>
    var myVideo = document.getElementById(“video1”);

    jQuery(document).ready(function() {
    document.getElementById(“BeyondTomorrowButton”).onclick = function() { PlayBeyondTomorrowClick() };
    });

    function PlayBeyondTomorrowClick() {
    myVideo.src = “https://xxx.com/media-player/BeyondTomorrow(1940)480i.mp4&#8221;;
    myVideo.load();
    myVideo.play();
    }

    </script>
    ================================================

    … the .src property is set when the button is clicked as I can see that in the browsers developer console, but the .Load and .Play methods do not appear to be available.

    Does anyone now how I can load and play a video specified via a url using Javascript in a button .onClick event?

    Thanks in advance to anyone who can help.

    drc 🙂

    #49950
    Abanob
    Keymaster

    [SOLVED] Answered on our support ticket system.

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