Added backwards compatibility for <div> embeds

This commit is contained in:
Sam Potts
2018-02-06 00:24:48 +11:00
parent 70c9fbdde3
commit 2150c44036
13 changed files with 120 additions and 246 deletions

View File

@ -51,7 +51,16 @@ const vimeo = {
gesture: 'media',
};
const params = utils.buildUrlParams(options);
const id = utils.parseVimeoId(player.media.getAttribute('src'));
// Get the source URL or ID
let source = player.media.getAttribute('src');
// Get from <div> if needed
if (utils.is.empty(source)) {
source = player.media.getAttribute(this.config.attributes.embed.id);
}
const id = utils.parseVimeoId(source);
// Build an iframe
const iframe = utils.createElement('iframe');