aboutsummaryrefslogtreecommitdiffstats
path: root/assets/js/simple-media.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/simple-media.js')
-rw-r--r--assets/js/simple-media.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/assets/js/simple-media.js b/assets/js/simple-media.js
index 7179cd6b..09d67ce3 100644
--- a/assets/js/simple-media.js
+++ b/assets/js/simple-media.js
@@ -267,11 +267,10 @@ function InitPxVideo(options) {
obj.playAriaLabel = "Play video, " + options.videoTitle;
}
- // Get the container, video element, and controls container
+ // Get the container and video element
obj.container = document.getElementById(options.videoId);
obj.container.className = obj.container.className + " stopped";
obj.movie = obj.container.getElementsByTagName("video")[0];
- obj.controls = obj.container.getElementsByClassName("px-video-controls")[0];
// Remove native video controls
obj.movie.removeAttribute("controls");
@@ -281,11 +280,14 @@ function InitPxVideo(options) {
// Insert custom video controls
if (options.debug) {
- console.log("Inserting custom video controls");
+ console.log("Inserting custom controls...");
}
- obj.controls.innerHTML = options.html
+ obj.container.insertAdjacentHTML("beforeend", options.html
.replaceAll("{aria-label}", obj.playAriaLabel)
- .replaceAll("{id}", obj.randomNum);
+ .replaceAll("{id}", obj.randomNum));
+
+ // Store reference
+ obj.controls = obj.container.querySelector(".player-controls");
// Responsive ffs
// ----