Skip to content

Commit b1ba38a

Browse files
author
lijiahao
committed
update
1 parent 5fbdbc5 commit b1ba38a

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

renderer/pages/[locale]/stream.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import xStreamingPlayer from "xstreaming-player";
66
import ActionBar from "../../components/ActionBar";
77
import Display from "../../components/Display";
88
import Audio from "../../components/Audio";
9-
// import FailedModal from "../../components/FailedModal";
9+
import FailedModal from "../../components/FailedModal";
1010
import Loading from "../../components/Loading";
1111
import Perform from "../../components/Perform";
1212
import WarningModal from "../../components/WarningModal";
@@ -43,7 +43,7 @@ function Stream() {
4343
const [connectState, setConnectState] = useState("");
4444
const [sessionId, setSessionId] = useState("");
4545
const [showPerformance, setShowPerformance] = useState(false);
46-
// const [showFailed, setShowFailed] = useState(false);
46+
const [showFailed, setShowFailed] = useState(false);
4747
const [showWarning, setShowWarning] = useState(false);
4848
const [showDisplay, setShowDisplay] = useState(false);
4949
const [showAudio, setShowAudio] = useState(false);
@@ -206,12 +206,8 @@ function Stream() {
206206
xPlayer.setConnectFailHandler(() => {
207207
// Not connected
208208
setShowWarning(false);
209-
// setShowFailed(true);
210-
alert(
211-
t(
212-
"NAT failed. If you are trying to stream remotely, please ensure that you have a public IPV4/6 address and that your router has port forwarding enabled for ports 9002/3074."
213-
)
214-
)
209+
setShowFailed(true);
210+
setLoading(false);
215211
});
216212

217213
xPlayer.setSdpHandler((client, offer) => {
@@ -707,12 +703,13 @@ function Stream() {
707703
)
708704
}
709705

710-
{/* <FailedModal
706+
<FailedModal
711707
show={showFailed}
712708
onCancel={() => {
713709
setShowFailed(false);
710+
onDisconnect();
714711
}}
715-
/> */}
712+
/>
716713

717714
<WarningModal
718715
show={showWarning}

0 commit comments

Comments
 (0)