about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/video/index.js
diff options
context:
space:
mode:
authorNolan Lawson <nolan@nolanlawson.com>2017-10-01 18:01:01 -0700
committerEugen Rochko <eugen@zeonfederated.com>2017-10-02 03:01:01 +0200
commitc567c874537b733a3e15625ad01eb0ae0ced8f4e (patch)
tree8a19679f120a44b1db13ad36c4d928922605afad /app/javascript/mastodon/features/video/index.js
parent47ecd652d3f8256a191401f005d42760e858e6de (diff)
Toggle contain:strict on fullscreen (#5159)
* Toggle contain:strict on fullscreen

* Fix scss lint issue

* fix scss whitespace lint issue
Diffstat (limited to 'app/javascript/mastodon/features/video/index.js')
-rw-r--r--app/javascript/mastodon/features/video/index.js30
1 files changed, 1 insertions, 29 deletions
diff --git a/app/javascript/mastodon/features/video/index.js b/app/javascript/mastodon/features/video/index.js
index 069264ef5..7502dda8b 100644
--- a/app/javascript/mastodon/features/video/index.js
+++ b/app/javascript/mastodon/features/video/index.js
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
 import { throttle } from 'lodash';
 import classNames from 'classnames';
+import { isFullscreen, requestFullscreen, exitFullscreen } from '../ui/util/fullscreen';
 
 const messages = defineMessages({
   play: { id: 'video.play', defaultMessage: 'Play' },
@@ -69,35 +70,6 @@ const getPointerPosition = (el, event) => {
   return position;
 };
 
-const isFullscreen = () => document.fullscreenElement ||
-  document.webkitFullscreenElement ||
-  document.mozFullScreenElement ||
-  document.msFullscreenElement;
-
-const exitFullscreen = () => {
-  if (document.exitFullscreen) {
-    document.exitFullscreen();
-  } else if (document.webkitExitFullscreen) {
-    document.webkitExitFullscreen();
-  } else if (document.mozCancelFullScreen) {
-    document.mozCancelFullScreen();
-  } else if (document.msExitFullscreen) {
-    document.msExitFullscreen();
-  }
-};
-
-const requestFullscreen = el => {
-  if (el.requestFullscreen) {
-    el.requestFullscreen();
-  } else if (el.webkitRequestFullscreen) {
-    el.webkitRequestFullscreen();
-  } else if (el.mozRequestFullScreen) {
-    el.mozRequestFullScreen();
-  } else if (el.msRequestFullscreen) {
-    el.msRequestFullscreen();
-  }
-};
-
 @injectIntl
 export default class Video extends React.PureComponent {