UNPKG

iframely

Version:

oEmbed/2 gateway endpoint. Get embed data for various http links through one self-hosted API

27 lines (21 loc) 887 B
export default { getLink: function (meta, whitelistRecord) { if (meta.video_src && whitelistRecord.isAllowed && whitelistRecord.isAllowed('html-meta.video')) { var player = { href: meta.video_src.href || meta.video_src, accept: [CONFIG.T.text_html, 'video/*'], rel: [CONFIG.R.player] }; if (whitelistRecord.isAllowed('html-meta.video', 'responsive')) { player['aspect-ratio'] = meta.video_width / meta.video_height; } else { player.width = meta.video_width; player.height = meta.video_height; } if (whitelistRecord.isAllowed('html-meta.video', CONFIG.R.autoplay)) { player.rel.push(CONFIG.R.autoplay); } return player; } } };