diff --git a/src/react-components/2d-hud.js b/src/react-components/2d-hud.js index bda0fe1080e3ca086d42667b6ce6ea24299d8669..009bf7d11ee5e7d396447025966fa94b5f324401 100644 --- a/src/react-components/2d-hud.js +++ b/src/react-components/2d-hud.js @@ -44,12 +44,11 @@ class TopHUD extends Component { buildVideoSharingButtons = () => { if (this.props.availableVREntryTypes.isInHMD) return null; + const isMobile = AFRAME.utils.device.isMobile(); const videoShareExtraOptionTypes = []; const primaryVideoShareType = - this.props.videoShareMediaSource || - this.state.lastActiveMediaSource || - (AFRAME.utils.device.isMobile() ? "camera" : "screen"); + this.props.videoShareMediaSource || this.state.lastActiveMediaSource || (isMobile ? "camera" : "screen"); if (this.state.showVideoShareOptions) { videoShareExtraOptionTypes.push(primaryVideoShareType); @@ -62,6 +61,8 @@ class TopHUD extends Component { } const showExtrasOnHover = () => { + if (isMobile) return; + clearTimeout(this.hideVideoSharingButtonTimeout); if (!this.props.videoShareMediaSource) { diff --git a/src/scene-entry-manager.js b/src/scene-entry-manager.js index 6614d9be1c7baa946d9e28c3034a13bca6ef2dc6..2e11588f2992988463c264133923a0acacfe899a 100644 --- a/src/scene-entry-manager.js +++ b/src/scene-entry-manager.js @@ -302,7 +302,7 @@ export default class SceneEntryManager { if (isHandlingVideoShare) return; isHandlingVideoShare = true; - if (currentVideoShareEntity.parentNode) { + if (currentVideoShareEntity && currentVideoShareEntity.parentNode) { currentVideoShareEntity.parentNode.removeChild(currentVideoShareEntity); }