summaryrefslogtreecommitdiff
path: root/client/src/lib/components/youtube.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/lib/components/youtube.js')
-rw-r--r--client/src/lib/components/youtube.js8
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(){