From 3064af9ad34c606ac199369bfe86346d00471fac Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 4 Jun 2017 17:30:25 -0400 Subject: bonkers scroll bugs --- client/src/lib/components/youtube.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'client/src/lib/components/youtube.js') 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(){ -- cgit v1.2.3-70-g09d2