Skip to content

Commit 1d40a9e

Browse files
committed
Revert "deployed successfully for the livestream"
This reverts commit 7d1fdde.
1 parent 7d1fdde commit 1d40a9e

File tree

7 files changed

+7
-249
lines changed

7 files changed

+7
-249
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,6 @@
220220
"worker-loader": "^2.0.0"
221221
},
222222
"optionalDependencies": {
223-
"fsevents": "^2.3.2"
223+
"fsevents": "^2.2.1"
224224
}
225225
}

src/naf-dialog-adapter.js

Lines changed: 3 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ export default class DialogAdapter {
6868
this._recvTaskId = null;
6969
this._closed = true;
7070
this.scene = document.querySelector("a-scene");
71-
this._webcams = {}; // { [consumerId]: {stream,order}, ["mine"]: {}}
7271
}
7372

7473
get serverUrl() {
@@ -406,25 +405,13 @@ export default class DialogAdapter {
406405
consumer.on("transportclose", () => {
407406
this.emitRTCEvent("error", "RTC", () => `Consumer transport closed`);
408407
this.removeConsumer(consumer.id);
409-
this.removeWebcam(consumer.id);
410-
411-
console.log("NAF dialog adapter.js request(): transportclosed");
412-
// console.log("producerId: " + producerId);
413-
// console.log("consumer.id: " + consumer.id);
414-
// console.log("peerId: " + peerId);
415408
});
416409

417410
// We are ready. Answer the protoo request so the server will
418411
// resume this Consumer (which was paused for now if video).
419412
accept();
420413

421-
// this.resolvePendingMediaRequestForTrack(peerId, consumer.track);
422-
423-
this.resolvePendingMediaRequestForTrack(peerId, consumer.track, consumer.id);
424-
425-
if (kind === "video") {
426-
console.log("Is video stream");
427-
}
414+
this.resolvePendingMediaRequestForTrack(peerId, consumer.track);
428415

429416
if (kind === "audio") {
430417
const initialAudioResolver = this._initialAudioConsumerResolvers.get(peerId);
@@ -509,7 +496,6 @@ export default class DialogAdapter {
509496

510497
consumer.close();
511498
this.removeConsumer(consumer.id);
512-
this.removeWebcam(consumer.id);
513499

514500
break;
515501
}
@@ -533,69 +519,20 @@ export default class DialogAdapter {
533519
await Promise.all([this.updateTimeOffset(), this._initialAudioConsumerPromise]);
534520
}
535521

536-
removeWebcam(consumerId) {
537-
console.log("removeWebCam()");
538-
console.log("removeWebCam() consumerId: " + consumerId);
539-
// const video = document.getElementById("webcam-feed-" + consumerId);
540-
// console.log(video);
541-
const webcam = this._webcams[consumerId];
542-
if (webcam) {
543-
delete this._webcams[consumerId];
544-
} else {
545-
// doesn't exist
546-
console.error("The consumerId doesnt exist to delete webcam");
547-
}
548-
this.scene.emit("webcams-changed");
549-
// if (video) {
550-
// console.log("video exists");
551-
// console.log(video);
552-
// video.remove();
553-
// }
554-
}
555-
556-
removeMyWebcam() {
557-
console.log("removeMyWebCam()");
558-
this.removeWebcam("mine");
559-
}
560-
561-
addWebcam(consumerId, stream) {
562-
// consumerId | mine
563-
// consumerId or mine
564-
console.log("addWebcam()");
565-
console.log("clientId: " + consumerId);
566-
const webcam = this._webcams[consumerId];
567-
if (!webcam) {
568-
this._webcams[consumerId] = { consumerId, stream, order: -1 };
569-
} else {
570-
// exists
571-
this._webcams[consumerId].stream = stream;
572-
}
573-
this.scene.emit("webcams-changed");
574-
}
575-
576522
shouldStartConnectionTo() {
577523
return true;
578524
}
579525
startStreamConnection() {}
580526

581527
closeStreamConnection() {}
582528

583-
resolvePendingMediaRequestForTrack(clientId, track, consumerId) {
529+
resolvePendingMediaRequestForTrack(clientId, track) {
584530
const requests = this._pendingMediaRequests.get(clientId);
585531

586532
if (requests && requests[track.kind]) {
587533
const resolve = requests[track.kind].resolve;
588534
delete requests[track.kind];
589-
// resolve(new MediaStream([track]));
590-
const stream = new MediaStream([track]);
591-
592-
if (track.kind === "video") {
593-
console.log(2);
594-
// this.addWebcam(clientId, stream);
595-
if (consumerId === undefined) this.addWebcam("mine", stream);
596-
else this.addWebcam(consumerId, stream);
597-
}
598-
resolve(stream);
535+
resolve(new MediaStream([track]));
599536
}
600537

601538
if (requests && Object.keys(requests).length === 0) {

src/react-components/room/FloatingShareVideo.js

Lines changed: 0 additions & 129 deletions
This file was deleted.

src/react-components/room/FloatingShareVideo.scss

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/react-components/ui-root.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import classNames from "classnames";
44
import copy from "copy-to-clipboard";
55
import { FormattedMessage } from "react-intl";
66
import screenfull from "screenfull";
7-
import { FloatingShareVideo } from "./room/FloatingShareVideo";
87

98
import configs from "../utils/configs";
109
import { VR_DEVICE_AVAILABILITY } from "../utils/vr-caps-detect";
@@ -1588,7 +1587,6 @@ class UIRoot extends Component {
15881587
/>
15891588
)}
15901589
</div>
1591-
<FloatingShareVideo scene={this.props.scene} />
15921590
</ReactAudioContext.Provider>
15931591
</MoreMenuContextProvider>
15941592
);

src/scene-entry-manager.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,6 @@ export default class SceneEntryManager {
509509

510510
await NAF.connection.adapter.setLocalMediaStream(mediaStream);
511511
currentVideoShareEntity = null;
512-
NAF.connection.adapter.removeMyWebcam();
513512

514513
this.avatarRig.setAttribute("player-info", { isSharingAvatarCamera: false });
515514
this.scene.emit("share_video_disabled");

0 commit comments

Comments
 (0)