diff options
author | Sam Potts <sam@potts.es> | 2019-06-01 19:55:14 +1000 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2019-06-01 19:55:14 +1000 |
commit | 12c6282d14e3e06a7784760f83affc9195afed1f (patch) | |
tree | af1c6be692c4cf2679e7efc604896b686974368d /src/js/html5.js | |
parent | 996075decc6e8c0f0c5059dccea21b16020eb78b (diff) | |
parent | 0249772f019762ebd494ac409e597103820413c3 (diff) | |
download | plyr-12c6282d14e3e06a7784760f83affc9195afed1f.tar.lz plyr-12c6282d14e3e06a7784760f83affc9195afed1f.tar.xz plyr-12c6282d14e3e06a7784760f83affc9195afed1f.zip |
Merge branch 'develop' into css-variables
# Conflicts:
# .eslintrc
# demo/dist/demo.css
# demo/dist/demo.js
# demo/dist/demo.min.js
# demo/dist/demo.min.js.map
# dist/plyr.css
# dist/plyr.js
# dist/plyr.min.js
# dist/plyr.min.js.map
# dist/plyr.min.mjs
# dist/plyr.min.mjs.map
# dist/plyr.mjs
# dist/plyr.polyfilled.js
# dist/plyr.polyfilled.min.js
# dist/plyr.polyfilled.min.js.map
# dist/plyr.polyfilled.min.mjs
# dist/plyr.polyfilled.min.mjs.map
# dist/plyr.polyfilled.mjs
# gulpfile.js
# package.json
Diffstat (limited to 'src/js/html5.js')
-rw-r--r-- | src/js/html5.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/js/html5.js b/src/js/html5.js index 3266a58e..e538e922 100644 --- a/src/js/html5.js +++ b/src/js/html5.js @@ -6,6 +6,7 @@ import support from './support'; import { removeElement } from './utils/elements'; import { triggerEvent } from './utils/events'; import is from './utils/is'; +import { setAspectRatio } from './utils/style'; const html5 = { getSources() { @@ -43,12 +44,15 @@ const html5 = { const player = this; + // Set aspect ratio if set + 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')); @@ -56,9 +60,8 @@ const html5 = { set(input) { // 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) { |