Skip to content

Commit

Permalink
fix(player): Added missing workflow to allow player to toggle fullscr…
Browse files Browse the repository at this point in the history
…een if user is in fullscreen mode and controls are recreated
  • Loading branch information
rafa8626 committed Jan 31, 2019
1 parent d9c489e commit e95db57
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion dist/openplayer.js
Expand Up @@ -5190,7 +5190,7 @@ var Fullscreen = function () {

this.player = player;
this.labels = player.getOptions().labels;
this.isFullscreen = false;
this.isFullscreen = document.body.classList.contains('op-fullscreen__on');
var target = document;
this.fullScreenEnabled = !!(target.fullscreenEnabled || target.mozFullScreenEnabled || target.msFullscreenEnabled || target.webkitSupportsFullscreen || target.webkitFullscreenEnabled || document.createElement('video').webkitRequestFullScreen);
return this;
Expand Down Expand Up @@ -5255,6 +5255,8 @@ var Fullscreen = function () {
} else {
this._fullscreenChange();
}

document.body.classList.remove('op-fullscreen__on');
} else {
var video = this.player.getElement();
this.fullscreenWidth = window.screen.width;
Expand All @@ -5273,6 +5275,8 @@ var Fullscreen = function () {
} else {
this._fullscreenChange();
}

document.body.classList.add('op-fullscreen__on');
}
}
}, {
Expand Down
2 changes: 1 addition & 1 deletion dist/openplayer.min.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/js/controls/fullscreen.ts
Expand Up @@ -101,7 +101,7 @@ class Fullscreen implements PlayerComponent {
constructor(player: Player) {
this.player = player;
this.labels = player.getOptions().labels;
this.isFullscreen = false;
this.isFullscreen = document.body.classList.contains('op-fullscreen__on');

const target = (document as any);

Expand Down Expand Up @@ -188,6 +188,7 @@ class Fullscreen implements PlayerComponent {
} else {
this._fullscreenChange();
}
document.body.classList.remove('op-fullscreen__on');
} else {
const video = (this.player.getElement() as any);
this.fullscreenWidth = window.screen.width;
Expand All @@ -206,6 +207,8 @@ class Fullscreen implements PlayerComponent {
} else {
this._fullscreenChange();
}

document.body.classList.add('op-fullscreen__on');
}
}

Expand Down

0 comments on commit e95db57

Please sign in to comment.