aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/utils.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2018-06-11 13:21:05 +1000
committerGitHub <noreply@github.com>2018-06-11 13:21:05 +1000
commit7d26f41d646d37e52fa774c99c603aa0663c51d4 (patch)
tree40a352afc6088130aad907f2f5e3bdb54deb46b4 /src/js/utils.js
parentf37f465ce452f33a0b1b06f2fd07ed014906b715 (diff)
parent41012a9843558f67bac7969ffe5bf7161a10893c (diff)
downloadplyr-7d26f41d646d37e52fa774c99c603aa0663c51d4.tar.lz
plyr-7d26f41d646d37e52fa774c99c603aa0663c51d4.tar.xz
plyr-7d26f41d646d37e52fa774c99c603aa0663c51d4.zip
Merge pull request #1015 from friday/captions-fixes-again
Captions rewrite (use index internally to support missing or duplicate languages)
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 a7d2ada4..109de031 100644
--- a/src/js/utils.js
+++ b/src/js/utils.js
@@ -831,6 +831,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));