Selaa lähdekoodia

Merge branch 'master' of http://face3d.4dage.com:7005/xushiting/Metaverse

gemercheung 3 vuotta sitten
vanhempi
commit
1dd5c7c52a
2 muutettua tiedostoa jossa 36 lisäystä ja 30 poistoa
  1. 1 1
      src/Reporter.js
  2. 35 29
      src/Rtcp.js

+ 1 - 1
src/Reporter.js

@@ -61,7 +61,7 @@ export default class Reporter extends EventEmitter {
             header: this._header,
             body: this._queue.splice(0, REPORT_NUM_PER_REQUEST)
         };
-        this._post(e)
+        //this._post(e)
     }
     _post(e) {
         const t = this._reportUrl || REPORT_URL.DEV;

+ 35 - 29
src/Rtcp.js

@@ -20,6 +20,7 @@ export default class Rtcp extends EventEmitter {
         E(this, "workers");
         E(this, "actived", !0);
         E(this, "heartbeat");
+        /*
         E(this, "onIcecandidate", e=>{
             if (e.candidate != null) {
                 const t = JSON.stringify(e.candidate);
@@ -45,6 +46,7 @@ export default class Rtcp extends EventEmitter {
             }
         }
         );
+        
         E(this, "onIceConnectionStateChange", ()=>{
             if (!!this.connection)
                 switch (logger.info(`iceConnectionState: ${this.connection.iceConnectionState}`),
@@ -117,6 +119,7 @@ export default class Rtcp extends EventEmitter {
             }
         }
         );
+        
         E(this, "input", e=>{
             // var t = this.inputChannel
             // if(!this.actived || !this.inputChannel || this.inputChannel.readyState === "open"){
@@ -128,14 +131,15 @@ export default class Rtcp extends EventEmitter {
             // }
             //!this.actived || !this.inputChannel || this.inputChannel.readyState === "open" && (t == null || t.send(e))
         }
-        );
+        );*/
+
         this.network = e,
         this.workers = new Workers(this,logger),
         this.workers.registerLogger(logger),
         this.workers.registerFunction("data", t=>{
             this.emit("data", t)
-        }
-        ),
+        });
+
         this.heartbeat = new Heartbeat({
             ping: t=>{
                 e.room.actionsHandler.echo(t)
@@ -154,6 +158,7 @@ export default class Rtcp extends EventEmitter {
    
 
     start() {
+        /*
         this.connection = new RTCPeerConnection;
         const e = Date.now();
         this.connection.ondatachannel = t=>{
@@ -201,31 +206,32 @@ export default class Rtcp extends EventEmitter {
         //         is_mobile: !0
         //     })
         // })
+        */
     }
-    addCandidate(e) {
-        e === "" ? this.network.rtcp.flushCandidate() : this.candidates.push(e)
-    }
-    disconnect() {
-        var e, t, r;
-        this.heartbeat.stop(),
-        logger.info("ready to close datachannel, id", (e = this.inputChannel) == null ? void 0 : e.id),
-        (t = this.inputChannel) == null || t.close(),
-        (r = this.connection) == null || r.close(),
-        this.connection = null,
-        this.inputChannel = null
-    }
-    sendStringData(e) {
-        console.log('e',e)
-        this.input(e)
-    }
-    sendData(e) {
-        let t = "";
-        try {
-            t = JSON.stringify(e)
-        } catch (r) {
-            logger.error(r);
-            return
-        }
-        this.input(t)
-    }
+    // addCandidate(e) {
+    //     e === "" ? this.network.rtcp.flushCandidate() : this.candidates.push(e)
+    // }
+    // disconnect() {
+    //     var e, t, r;
+    //     this.heartbeat.stop(),
+    //     logger.info("ready to close datachannel, id", (e = this.inputChannel) == null ? void 0 : e.id),
+    //     (t = this.inputChannel) == null || t.close(),
+    //     (r = this.connection) == null || r.close(),
+    //     this.connection = null,
+    //     this.inputChannel = null
+    // }
+    // sendStringData(e) {
+    //     console.log('e',e)
+    //     this.input(e)
+    // }
+    // sendData(e) {
+    //     let t = "";
+    //     try {
+    //         t = JSON.stringify(e)
+    //     } catch (r) {
+    //         logger.error(r);
+    //         return
+    //     }
+    //     this.input(t)
+    // }
 }