diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-06-04 17:30:25 -0400 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-06-04 17:30:25 -0400 |
| commit | 3064af9ad34c606ac199369bfe86346d00471fac (patch) | |
| tree | b432cac458c9734fb492743800065d2eb3d19f35 /client/src/lib/components/youtube.js | |
| parent | 85968a3a6bc5737715ed34fba942153174d2c993 (diff) | |
bonkers scroll bugs
Diffstat (limited to 'client/src/lib/components/youtube.js')
| -rw-r--r-- | client/src/lib/components/youtube.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/client/src/lib/components/youtube.js b/client/src/lib/components/youtube.js index ab5f8aa..a9ea740 100644 --- a/client/src/lib/components/youtube.js +++ b/client/src/lib/components/youtube.js @@ -25,7 +25,7 @@ export default class Youtube extends Component { this.player = new YT.Player(this.container, { videoId: this.props.ytid, width: "100%", - height: 400, + height: isMobile ? 100 : 400, playerVars: { 'autohide': 1, 'autoplay': 0, @@ -83,6 +83,12 @@ export default class Youtube extends Component { } } +const isIphone = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) +const isIpad = (navigator.userAgent.match(/iPad/i)) +const isAndroid = (navigator.userAgent.match(/Android/i)) +const isMobile = isIphone || isIpad || isAndroid +const isDesktop = ! isMobile + let YT_READY = false global.onYouTubeIframeAPIReady = function(){ |
