- This topic has 1 reply, 2 voices, and was last updated 4 years, 9 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
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”;
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 🙂
[SOLVED] Answered on our support ticket system.
Leap13 is a 5 Stars rated WordPress focused web development firm specialized in building Premium WordPress Themes and Plugins.
Enter your email and be the first to receive our latest news!
© 2024 Leap13 - Proudly Made by Wiz - The Smart Theme