Skip to content

Commit

Permalink
add none to ScreenOrientationType
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuvalke committed Nov 24, 2020
1 parent cfc4507 commit 43627ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/fullscreen/fullscreen-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class FullscreenController {
_isScreenLocked: boolean = false;
_isScreenOrientationSupport: boolean =
// $FlowFixMe
screen && screen.orientation && typeof screen.orientation.unlock === 'function' && typeof screen.orientation.lock === 'function';
!!screen && !!screen.orientation && typeof screen.orientation.unlock === 'function' && typeof screen.orientation.lock === 'function';
_eventManager: EventManager;
// Flag to overcome browsers which supports more than one fullscreenchange event
_isFullscreenEventDispatched: boolean = false;
Expand Down Expand Up @@ -172,7 +172,8 @@ class FullscreenController {
() => {
this._isInFullscreen = true;
const screenLockOrientionMode = Utils.Object.getPropertyPath(this._player, 'config.playback.screenLockOrientionMode');
const validOrientation = Object.values(ScreenOrientationType).includes(screenLockOrientionMode);
const validOrientation =
screenLockOrientionMode !== ScreenOrientationType.NONE && Object.values(ScreenOrientationType).includes(screenLockOrientionMode);
if (this._isScreenOrientationSupport && validOrientation) {
screen.orientation
// $FlowFixMe
Expand Down
4 changes: 3 additions & 1 deletion src/player-config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {ScreenOrientationType} from './screen-orientation-type';

const DefaultConfig = {
log: {
level: 'ERROR'
Expand Down Expand Up @@ -37,7 +39,7 @@ const DefaultConfig = {
dash: false
},
inBrowserFullscreen: false,
screenLockOrientionMode: '',
screenLockOrientionMode: ScreenOrientationType.NONE,
playAdsWithMSE: false,
streamPriority: [
{
Expand Down
1 change: 1 addition & 0 deletions src/screen-orientation-type.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @flow
const ScreenOrientationType: PKOrientationType = {
NONE: 'none',
ANY: 'any',
NATURAL: 'natural',
LANDSCAPE: 'landscape',
Expand Down

0 comments on commit 43627ea

Please sign in to comment.