@@ -9,6 +9,7 @@ import document from 'global/document';
99import window from 'global/window' ;
1010import tsml from 'tsml' ;
1111import evented from './mixins/evented' ;
12+ import { isEvented , addEventedCallback } from './mixins/evented' ;
1213import * as Events from './utils/events.js' ;
1314import * as Dom from './utils/dom.js' ;
1415import * as Fn from './utils/fn.js' ;
@@ -442,6 +443,9 @@ class Player extends Component {
442443 // Make this an evented object and use `el_` as its event bus.
443444 evented ( this , { eventBusKey : 'el_' } ) ;
444445
446+ if ( this . fluid_ ) {
447+ this . on ( 'playerreset' , this . updateStyleEl_ ) ;
448+ }
445449 // We also want to pass the original player options to each component and plugin
446450 // as well so they don't need to reach back into the player for options later.
447451 // We also need to do another copy of this.options_ so we don't end up with
@@ -825,9 +829,15 @@ class Player extends Component {
825829
826830 this . fluid_ = ! ! bool ;
827831
832+ if ( isEvented ( this ) ) {
833+ this . off ( 'playerreset' , this . updateStyleEl_ ) ;
834+ }
828835 if ( bool ) {
829836 this . addClass ( 'vjs-fluid' ) ;
830837 this . fill ( false ) ;
838+ addEventedCallback ( function ( ) {
839+ this . on ( 'playerreset' , this . updateStyleEl_ ) ;
840+ } ) ;
831841 } else {
832842 this . removeClass ( 'vjs-fluid' ) ;
833843 }
@@ -2910,6 +2920,9 @@ class Player extends Component {
29102920 }
29112921 this . loadTech_ ( this . options_ . techOrder [ 0 ] , null ) ;
29122922 this . techCall_ ( 'reset' ) ;
2923+ if ( isEvented ( this ) ) {
2924+ this . trigger ( 'playerreset' ) ;
2925+ }
29132926 }
29142927
29152928 /**
0 commit comments