diff options
author | Sam Potts <me@sampotts.me> | 2017-11-06 19:38:31 +1100 |
---|---|---|
committer | Sam Potts <me@sampotts.me> | 2017-11-06 19:38:31 +1100 |
commit | 006871074032e5b24408fb654eb2856585c491e1 (patch) | |
tree | 7fdfd71a6ff6bc1abef9d343e87e9f9f08a34346 /src/js/plugins/youtube.js | |
parent | 5fe477340b7c446dcbf711daa06d81c725c45b34 (diff) | |
download | plyr-006871074032e5b24408fb654eb2856585c491e1.tar.lz plyr-006871074032e5b24408fb654eb2856585c491e1.tar.xz plyr-006871074032e5b24408fb654eb2856585c491e1.zip |
Started on documentation and aspect ratio option
Diffstat (limited to 'src/js/plugins/youtube.js')
-rw-r--r-- | src/js/plugins/youtube.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/js/plugins/youtube.js b/src/js/plugins/youtube.js index 38f649a5..2c8557dc 100644 --- a/src/js/plugins/youtube.js +++ b/src/js/plugins/youtube.js @@ -17,6 +17,10 @@ const youtube = { // Add embed class for responsive utils.toggleClass(this.elements.wrapper, this.config.classNames.embed, true); + // Set aspect ratio + const ratio = this.config.ratio.split(':'); + this.elements.wrapper.style.paddingBottom = `${100 / ratio[0] * ratio[1]}%`; + // Set ID this.media.setAttribute('id', utils.generateId(this.type)); |