From c0f0350cfc8e778a9369a91f31c3333a15f39589 Mon Sep 17 00:00:00 2001 From: DoomTay Date: Thu, 5 Jul 2018 16:28:37 -0400 Subject: [PATCH] feat(fullscreen-toggle): disable fs button if fullcreen is unavailable (#5296) Fixes #5290. --- src/js/control-bar/fullscreen-toggle.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/js/control-bar/fullscreen-toggle.js b/src/js/control-bar/fullscreen-toggle.js index a565ee3695..45987a78db 100644 --- a/src/js/control-bar/fullscreen-toggle.js +++ b/src/js/control-bar/fullscreen-toggle.js @@ -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 @@ -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(); + } } /**