diff options
author | Sam Potts <sam@potts.es> | 2019-06-21 00:12:10 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-21 00:12:10 +1000 |
commit | 95092edc93d713b927c637cefc27945f8537d565 (patch) | |
tree | 27464f2f98a519f78ff3cc4a2c49ebdd5c6dab2c /src/js/html5.js | |
parent | 1e761e237aceb49b29291946a39eef958d6da966 (diff) | |
parent | c4b3e0672e86f2a2786f315bf8f54250cd1f7f78 (diff) | |
download | plyr-95092edc93d713b927c637cefc27945f8537d565.tar.lz plyr-95092edc93d713b927c637cefc27945f8537d565.tar.xz plyr-95092edc93d713b927c637cefc27945f8537d565.zip |
Merge pull request #1472 from sampotts/develop
v3.5.5
Diffstat (limited to 'src/js/html5.js')
-rw-r--r-- | src/js/html5.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/js/html5.js b/src/js/html5.js index 0d9a64ea..b03e9c26 100644 --- a/src/js/html5.js +++ b/src/js/html5.js @@ -44,15 +44,17 @@ const html5 = { const player = this; - // Set aspect ratio if set - setAspectRatio.call(player); + // Set aspect ratio if fixed + if (!is.empty(this.config.ratio)) { + setAspectRatio.call(player); + } // Quality Object.defineProperty(player.media, 'quality', { get() { // Get sources const sources = html5.getSources.call(player); - const source = sources.find(source => source.getAttribute('src') === player.source); + const source = sources.find(s => s.getAttribute('src') === player.source); // Return size, if match is found return source && Number(source.getAttribute('size')); @@ -61,7 +63,7 @@ const html5 = { // Get sources const sources = html5.getSources.call(player); // Get first match for requested size - const source = sources.find(source => Number(source.getAttribute('size')) === input); + const source = sources.find(s => Number(s.getAttribute('size')) === input); // No matching source found if (!source) { |