From 6ed4af3f9392a454fb9bc5fc2f3c4967cc8edb35 Mon Sep 17 00:00:00 2001
From: Greg Fodor <gfodor@gmail.com>
Date: Thu, 1 Nov 2018 04:59:15 +0000
Subject: [PATCH] Rename dialog class

---
 src/components/media-views.js                             | 1 +
 src/react-components/ui-root.js                           | 8 ++++----
 ...dialog.js => webrtc-screenshare-unsupported-dialog.js} | 8 ++++++--
 3 files changed, 11 insertions(+), 6 deletions(-)
 rename src/react-components/{webrtc-screenshare-dialog.js => webrtc-screenshare-unsupported-dialog.js} (77%)

diff --git a/src/components/media-views.js b/src/components/media-views.js
index 49eae14a3..1043c6b49 100644
--- a/src/components/media-views.js
+++ b/src/components/media-views.js
@@ -328,6 +328,7 @@ AFRAME.registerComponent("media-video", {
       }
 
       if (!src.startsWith("webrtc://")) {
+        // TODO FF error here if binding mediastream: The captured HTMLMediaElement is playing a MediaStream. Applying volume or mute status is not currently supported -- not an issue since we have no audio atm in shared video.
         texture.audioSource = this.el.sceneEl.audioListener.context.createMediaElementSource(texture.image);
 
         const sound = new THREE.PositionalAudio(this.el.sceneEl.audioListener);
diff --git a/src/react-components/ui-root.js b/src/react-components/ui-root.js
index 56889d422..677c8b4f6 100644
--- a/src/react-components/ui-root.js
+++ b/src/react-components/ui-root.js
@@ -23,7 +23,7 @@ import ProfileEntryPanel from "./profile-entry-panel";
 import HelpDialog from "./help-dialog.js";
 import SafariDialog from "./safari-dialog.js";
 import WebVRRecommendDialog from "./webvr-recommend-dialog.js";
-import WebRTCScreenshareDialog from "./webrtc-screenshare-dialog.js";
+import WebRTCScreenshareUnsupportedDialog from "./webrtc-screenshare-unsupported-dialog.js";
 import InviteTeamDialog from "./invite-team-dialog.js";
 import InviteDialog from "./invite-dialog.js";
 import LinkDialog from "./link-dialog.js";
@@ -567,8 +567,8 @@ class UIRoot extends Component {
     this.setState({ dialog: <WebVRRecommendDialog onClose={this.closeDialog} /> });
   };
 
-  showWebRTCScreenshareDialog = () => {
-    this.setState({ dialog: <WebRTCScreenshareDialog onClose={this.closeDialog} /> });
+  showWebRTCScreenshareUnsupportedDialog = () => {
+    this.setState({ dialog: <WebRTCScreenshareUnsupportedDialog onClose={this.closeDialog} /> });
   };
 
   onMiniInviteClicked = () => {
@@ -1156,7 +1156,7 @@ class UIRoot extends Component {
                 onToggleSpaceBubble={this.toggleSpaceBubble}
                 onShareVideo={this.shareVideo}
                 onEndShareVideo={this.endShareVideo}
-                onShareVideoNotCapable={() => this.showWebRTCScreenshareDialog()}
+                onShareVideoNotCapable={() => this.showWebRTCScreenshareUnsupportedDialog()}
                 onSpawnPen={this.spawnPen}
                 onSpawnCamera={() => this.props.scene.emit("action_spawn_camera")}
               />
diff --git a/src/react-components/webrtc-screenshare-dialog.js b/src/react-components/webrtc-screenshare-unsupported-dialog.js
similarity index 77%
rename from src/react-components/webrtc-screenshare-dialog.js
rename to src/react-components/webrtc-screenshare-unsupported-dialog.js
index fdc35d43d..c77148695 100644
--- a/src/react-components/webrtc-screenshare-dialog.js
+++ b/src/react-components/webrtc-screenshare-unsupported-dialog.js
@@ -1,12 +1,16 @@
 import React, { Component } from "react";
 import DialogContainer from "./dialog-container.js";
 
-export default class WebRTCScreenshareDialog extends Component {
+export default class WebRTCScreenshareUnsupportedDialog extends Component {
   render() {
     return (
       <DialogContainer title="Share Screen" {...this.props}>
         <div style={{ display: "flex", flexDirection: "column", alignItems: "center" }}>
-          <p>To share your screen, you can use Firefox.</p>
+          <p>
+            Your browser doesn&apos;t seem to support WebRTC screen sharing.
+            <br />
+            To share your screen in Hubs, you can use Firefox.
+          </p>
           <a
             className="info-dialog--action-button"
             target="_blank"
-- 
GitLab