File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,19 @@ define([
1919 vimeoPattern . test ( url ) ;
2020 }
2121
22+ function getValidDimension ( value , fallback ) {
23+ if ( ! value || parseFloat ( value ) === 0 ) {
24+ return fallback ;
25+ }
26+ return value ;
27+ }
28+
2229 return function ( config , element ) {
2330 const videoElementContainer = $ ( element ) ;
2431 const videoElement = videoElementContainer [ 0 ] ;
2532 const videoElementStyles = window . getComputedStyle ( element ) ;
26- const height = videoElementStyles . minHeight || '300px' ;
27- const width = videoElementStyles . width || '400px' ;
33+ const height = getValidDimension ( videoElementStyles . minHeight , '300px' ) ;
34+ const width = getValidDimension ( videoElementStyles . width , '400px' ) ;
2835
2936 if ( videoElementContainer . data ( 'background-type' ) !== 'video' ) {
3037 originalWidget ( config , element ) ;
You can’t perform that action at this time.
0 commit comments