aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/utils.js
diff options
context:
space:
mode:
authorAlbin Larsson <mail@albinlarsson.com>2018-06-04 14:22:09 +0200
committerAlbin Larsson <mail@albinlarsson.com>2018-06-08 11:44:15 +0200
commitb12eeb0eb7b59671bb887770fc787940e4659a21 (patch)
tree176dd43911acc9b357f56160de1abcfb036ca863 /src/js/utils.js
parent8e634862ff7a1307f3e72c7ed6a92092711ab4d5 (diff)
downloadplyr-b12eeb0eb7b59671bb887770fc787940e4659a21.tar.lz
plyr-b12eeb0eb7b59671bb887770fc787940e4659a21.tar.xz
plyr-b12eeb0eb7b59671bb887770fc787940e4659a21.zip
Merge captions setText and setCue into updateCues (fixes #998 and vimeo cuechange event)
Diffstat (limited to 'src/js/utils.js')
-rw-r--r--src/js/utils.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/js/utils.js b/src/js/utils.js
index b6ba0941..a152e121 100644
--- a/src/js/utils.js
+++ b/src/js/utils.js
@@ -833,6 +833,13 @@ const utils = {
return fragment.firstChild.innerText;
},
+ // Like outerHTML, but also works for DocumentFragment
+ getHTML(element) {
+ const wrapper = document.createElement('div');
+ wrapper.appendChild(element);
+ return wrapper.innerHTML;
+ },
+
// Get aspect ratio for dimensions
getAspectRatio(width, height) {
const getRatio = (w, h) => (h === 0 ? w : getRatio(h, w % h));