Vimeo offset tweak (fixes #826)

This commit is contained in:
Sam Potts 2018-03-22 01:08:08 +11:00
parent c251c94131
commit 5eafe9baff
12 changed files with 12 additions and 12 deletions

2
demo/dist/demo.css vendored

File diff suppressed because one or more lines are too long

2
dist/plyr.css vendored

File diff suppressed because one or more lines are too long

2
dist/plyr.js vendored
View File

@ -5773,7 +5773,7 @@ var vimeo = {
setAspectRatio: function setAspectRatio(input) { setAspectRatio: function setAspectRatio(input) {
var ratio = utils.is.string(input) ? input.split(':') : this.config.ratio.split(':'); var ratio = utils.is.string(input) ? input.split(':') : this.config.ratio.split(':');
var padding = 100 / ratio[0] * ratio[1]; var padding = 100 / ratio[0] * ratio[1];
var height = 200; var height = 240;
var offset = (height - padding) / (height / 50); var offset = (height - padding) / (height / 50);
this.elements.wrapper.style.paddingBottom = padding + '%'; this.elements.wrapper.style.paddingBottom = padding + '%';
this.media.style.transform = 'translateY(-' + offset + '%)'; this.media.style.transform = 'translateY(-' + offset + '%)';

2
dist/plyr.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/plyr.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -11671,7 +11671,7 @@ var vimeo = {
setAspectRatio: function setAspectRatio(input) { setAspectRatio: function setAspectRatio(input) {
var ratio = utils.is.string(input) ? input.split(':') : this.config.ratio.split(':'); var ratio = utils.is.string(input) ? input.split(':') : this.config.ratio.split(':');
var padding = 100 / ratio[0] * ratio[1]; var padding = 100 / ratio[0] * ratio[1];
var height = 200; var height = 240;
var offset = (height - padding) / (height / 50); var offset = (height - padding) / (height / 50);
this.elements.wrapper.style.paddingBottom = padding + '%'; this.elements.wrapper.style.paddingBottom = padding + '%';
this.media.style.transform = 'translateY(-' + offset + '%)'; this.media.style.transform = 'translateY(-' + offset + '%)';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -34,7 +34,7 @@ const vimeo = {
setAspectRatio(input) { setAspectRatio(input) {
const ratio = utils.is.string(input) ? input.split(':') : this.config.ratio.split(':'); const ratio = utils.is.string(input) ? input.split(':') : this.config.ratio.split(':');
const padding = 100 / ratio[0] * ratio[1]; const padding = 100 / ratio[0] * ratio[1];
const height = 200; const height = 240;
const offset = (height - padding) / (height / 50); const offset = (height - padding) / (height / 50);
this.elements.wrapper.style.paddingBottom = `${padding}%`; this.elements.wrapper.style.paddingBottom = `${padding}%`;
this.media.style.transform = `translateY(-${offset}%)`; this.media.style.transform = `translateY(-${offset}%)`;

View File

@ -6,7 +6,7 @@
.plyr__video-embed { .plyr__video-embed {
// Default to 16:9 ratio but this is set by JavaScript based on config // Default to 16:9 ratio but this is set by JavaScript based on config
$padding: ((100 / 16) * 9); $padding: ((100 / 16) * 9);
$height: 200; $height: 240;
$offset: to-percentage(($height - $padding) / ($height / 50)); $offset: to-percentage(($height - $padding) / ($height / 50));
height: 0; height: 0;