mirror of
https://github.com/videojs/video.js.git
synced 2024-11-24 08:42:25 +02:00
refactor: player.dimension() (#4704)
This commit is contained in:
parent
9acbcd8410
commit
ad1b47bf84
@ -659,17 +659,18 @@ class Player extends Component {
|
||||
if (value === '') {
|
||||
// If an empty string is given, reset the dimension to be automatic
|
||||
this[privDimension] = undefined;
|
||||
} else {
|
||||
const parsedVal = parseFloat(value);
|
||||
|
||||
if (isNaN(parsedVal)) {
|
||||
log.error(`Improper value "${value}" supplied for for ${dimension}`);
|
||||
return;
|
||||
}
|
||||
|
||||
this[privDimension] = parsedVal;
|
||||
this.updateStyleEl_();
|
||||
return;
|
||||
}
|
||||
|
||||
const parsedVal = parseFloat(value);
|
||||
|
||||
if (isNaN(parsedVal)) {
|
||||
log.error(`Improper value "${value}" supplied for for ${dimension}`);
|
||||
return;
|
||||
}
|
||||
|
||||
this[privDimension] = parsedVal;
|
||||
this.updateStyleEl_();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user