Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sadnessOjisan committed Jun 12, 2023
1 parent e93e6ef commit c699e6d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/contents/20230612-streaming-react-ui/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ socket.on("sdp_from_sender", (sdp: RTCSessionDescriptionInit) => {
.then(() => {
return pc.createAnswer();
})
.then((answerSdp) => {
return pc.setLocalDescription(answerSdp).then(() => {
state.socket.emit("sdp_from_receiver", answerSdp);
.then((sdp) => {
return pc.setLocalDescription(sdp).then(() => {
state.socket.emit("sdp_from_receiver", sdp);
});
});
});
Expand Down Expand Up @@ -402,12 +402,12 @@ socket.on("sdp_from_sender", (sdp) => {

```ts
socket.on("sdp_from_sender", (sdp: RTCSessionDescriptionInit) => {
pc.setRemoteDescription(state.peerSdp)
pc.setRemoteDescription(sdp)
.then(() => {
return pc.createAnswer();
})
.then((answerSdp) => {
return pc.setLocalDescription(answerSdp).then(() => {
.then((sdp) => {
return pc.setLocalDescription(sdp).then(() => {
// ここに socket が存在する保証はない
});
});
Expand Down Expand Up @@ -479,7 +479,7 @@ const reducer = (state: State, action: Action): State => {
case "initialize": {
return {
...state,
step: "search_room",
step: "wait_for_peer_peering_action",
socket: action.payload.socket,
pc: action.payload.pc,
};
Expand Down

0 comments on commit c699e6d

Please sign in to comment.