aboutsummaryrefslogtreecommitdiffstats
path: root/assets/js
diff options
context:
space:
mode:
authorSam Potts <me@sampotts.me>2015-02-15 02:46:11 +1100
committerSam Potts <me@sampotts.me>2015-02-15 02:46:11 +1100
commit61970a948e0a75d6bdbb14f40370eb952765e70c (patch)
tree9e20fe6adbe9e8a35388551a76d806c1c86bfdde /assets/js
parentf8c6dab92e3dcfbc62d3d47ea8bd857db37f95e8 (diff)
downloadplyr-61970a948e0a75d6bdbb14f40370eb952765e70c.tar.lz
plyr-61970a948e0a75d6bdbb14f40370eb952765e70c.tar.xz
plyr-61970a948e0a75d6bdbb14f40370eb952765e70c.zip
More styling
Diffstat (limited to 'assets/js')
-rw-r--r--assets/js/docs.js4
-rw-r--r--assets/js/simple-media.js12
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
// ----