Merge captions setText and setCue into updateCues (fixes #998 and vimeo cuechange event)

This commit is contained in:
Albin Larsson
2018-06-04 14:22:09 +02:00
parent 8e634862ff
commit b12eeb0eb7
4 changed files with 50 additions and 63 deletions
+7
View File
@@ -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));