Skip to content

Commit afea980

Browse files
nicolaslevygkatsev
authored andcommitted
fix: Don't enable player controls if they where disabled when ModalDialog closes. (#4690)
1 parent 43ddc72 commit afea980

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/js/modal-dialog.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ class ModalDialog extends Component {
187187
this.on(this.el_.ownerDocument, 'keydown', Fn.bind(this, this.handleKeyPress));
188188
}
189189

190+
// Hide controls and note if they were enabled.
191+
this.hadControls_ = player.controls();
190192
player.controls(false);
193+
191194
this.show();
192195
this.conditionalFocus_();
193196
this.el().setAttribute('aria-hidden', 'false');
@@ -249,7 +252,10 @@ class ModalDialog extends Component {
249252
this.off(this.el_.ownerDocument, 'keydown', Fn.bind(this, this.handleKeyPress));
250253
}
251254

252-
player.controls(true);
255+
if (this.hadControls_) {
256+
player.controls(true);
257+
}
258+
253259
this.hide();
254260
this.el().setAttribute('aria-hidden', 'true');
255261

0 commit comments

Comments
 (0)