@@ -652,9 +652,13 @@ class Player extends Component {
652
652
head . insertBefore ( this . styleEl_ , defaultsStyleEl ? defaultsStyleEl . nextSibling : head . firstChild ) ;
653
653
}
654
654
655
+ this . fill_ = false ;
656
+ this . fluid_ = false ;
657
+
655
658
// Pass in the width/height/aspectRatio options which will update the style el
656
659
this . width ( this . options_ . width ) ;
657
660
this . height ( this . options_ . height ) ;
661
+ this . fill ( this . options_ . fill ) ;
658
662
this . fluid ( this . options_ . fluid ) ;
659
663
this . aspectRatio ( this . options_ . aspectRatio ) ;
660
664
@@ -765,10 +769,12 @@ class Player extends Component {
765
769
/**
766
770
* A getter/setter/toggler for the vjs-fluid `className` on the `Player`.
767
771
*
772
+ * Turning this on will turn off fill mode.
773
+ *
768
774
* @param {boolean } [bool]
769
775
* - A value of true adds the class.
770
776
* - A value of false removes the class.
771
- * - No value will toggle the fluid class .
777
+ * - No value will be a getter .
772
778
*
773
779
* @return {boolean|undefined }
774
780
* - The value of fluid when getting.
@@ -783,13 +789,43 @@ class Player extends Component {
783
789
784
790
if ( bool ) {
785
791
this . addClass ( 'vjs-fluid' ) ;
792
+ this . fill ( false ) ;
786
793
} else {
787
794
this . removeClass ( 'vjs-fluid' ) ;
788
795
}
789
796
790
797
this . updateStyleEl_ ( ) ;
791
798
}
792
799
800
+ /**
801
+ * A getter/setter/toggler for the vjs-fill `className` on the `Player`.
802
+ *
803
+ * Turning this on will turn off fluid mode.
804
+ *
805
+ * @param {boolean } [bool]
806
+ * - A value of true adds the class.
807
+ * - A value of false removes the class.
808
+ * - No value will be a getter.
809
+ *
810
+ * @return {boolean|undefined }
811
+ * - The value of fluid when getting.
812
+ * - `undefined` when setting.
813
+ */
814
+ fill ( bool ) {
815
+ if ( bool === undefined ) {
816
+ return ! ! this . fill_ ;
817
+ }
818
+
819
+ this . fill_ = ! ! bool ;
820
+
821
+ if ( bool ) {
822
+ this . addClass ( 'vjs-fill' ) ;
823
+ this . fluid ( false ) ;
824
+ } else {
825
+ this . removeClass ( 'vjs-fill' ) ;
826
+ }
827
+ }
828
+
793
829
/**
794
830
* Get/Set the aspect ratio
795
831
*
@@ -3658,6 +3694,9 @@ class Player extends Component {
3658
3694
const tagOptions = Dom . getAttributes ( tag ) ;
3659
3695
const dataSetup = tagOptions [ 'data-setup' ] ;
3660
3696
3697
+ if ( Dom . hasClass ( tag , 'vjs-fill' ) ) {
3698
+ tagOptions . fill = true ;
3699
+ }
3661
3700
if ( Dom . hasClass ( tag , 'vjs-fluid' ) ) {
3662
3701
tagOptions . fluid = true ;
3663
3702
}
0 commit comments