diff options
Diffstat (limited to 'assets/js')
-rw-r--r-- | assets/js/docs.js | 4 | ||||
-rw-r--r-- | assets/js/simple-media.js | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/assets/js/docs.js b/assets/js/docs.js index c8a3bd44..f80fe696 100644 --- a/assets/js/docs.js +++ b/assets/js/docs.js @@ -11,9 +11,7 @@ var video = new InitPxVideo({ "seekInterval": 20, "videoTitle": "PayPal Austin promo", "debug": true, - "html": templates.controls.render({ - - }) + "html": templates.controls.render({}) }); console.log(video);
\ No newline at end of file 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 // ---- |