Skip to content

Commit

Permalink
feat(fullscreen-toggle): disable fs button if fullcreen is unavailable (
Browse files Browse the repository at this point in the history
#5296)

Fixes #5290.
  • Loading branch information
DoomTay authored and gkatsev committed Jul 9, 2018
1 parent ab3a9b9 commit c0f0350
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/js/control-bar/fullscreen-toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*/
import Button from '../button.js';
import Component from '../component.js';
import FullscreenApi from '../fullscreen-api.js';
import document from 'global/document';

/**
* Toggle fullscreen video
Expand All @@ -23,6 +25,10 @@ class FullscreenToggle extends Button {
constructor(player, options) {
super(player, options);
this.on(player, 'fullscreenchange', this.handleFullscreenChange);

if (document[FullscreenApi.fullscreenEnabled] === false) {
this.disable();
}
}

/**
Expand Down

0 comments on commit c0f0350

Please sign in to comment.