diff options
Diffstat (limited to 'vnext')
-rw-r--r-- | vnext/src/utils/embed.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/vnext/src/utils/embed.js b/vnext/src/utils/embed.js index be96d036..f7f55eb7 100644 --- a/vnext/src/utils/embed.js +++ b/vnext/src/utils/embed.js @@ -72,8 +72,8 @@ function makeIframe(src, w, h, scrolling='no') { } function makeResizableToRatio(element, ratio) { - element.dataset['ratio'] = ratio; - makeResizable(element, w => w * element.dataset['ratio']); + element.setAttribute('data-ratio', ratio); + makeResizable(element, w => w * element.getAttribute('data-ratio')); } // calcHeight :: Number -> Number -- calculate element height for a given width @@ -205,7 +205,11 @@ function getEmbeddableLinkTypes() { .split('&') .map(s => s.split('=')) .forEach(z => pp[z[0]] = z[1]); - let embedArgs = { rel: '0' }; + let embedArgs = { + rel: '0', + enablejsapi: '1', + origin: `${window.location.protocol}//${window.location.host}` + }; if (pp.t) { const tre = /^(?:(\d+)|(?:(\d+)h)?(?:(\d+)m)?(\d+)s|(?:(\d+)h)?(\d+)m|(\d+)h)$/i; let [, t, h, m, s, h1, m1, h2] = tre.exec(pp.t); |