Skip to content

Commit

Permalink
fix(FEC-8107): fullscreen APIs on IOS devices (#212)
Browse files Browse the repository at this point in the history
Fix full screen APIs logic on iOS devices.
  • Loading branch information
Dan Ziv committed Apr 9, 2018
1 parent 22144ad commit 91df91d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/fullscreen/fullscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ class FullscreenControl extends BaseComponent {
* @memberof FullscreenControl
*/
enterFullscreen(): void {
if (this.props.isMobile && this.player.env.os.name === 'iOS') {
this.player.getVideoElement().webkitEnterFullscreen();
if (this.player.env.os.name === 'iOS') {
this.player.getVideoElement().webkitEnterFullScreen();
} else {
let elementToFullscreen = document.getElementById(this.props.targetId);
if (elementToFullscreen) {
Expand All @@ -167,7 +167,9 @@ class FullscreenControl extends BaseComponent {
* @memberof FullscreenControl
*/
exitFullscreen() {
if (typeof document.exitFullscreen === 'function') {
if (this.player.env.os.name === 'iOS') {
this.player.getVideoElement().webkitExitFullScreen();
} else if (typeof document.exitFullscreen === 'function') {
document.exitFullscreen();
} else if (typeof document.webkitExitFullscreen === 'function') {
document.webkitExitFullscreen();
Expand Down

0 comments on commit 91df91d

Please sign in to comment.