Browse Source

优化控制信息
Signed-off-by: caner <5658514@qq.com>

caner 3 years ago
parent
commit
7ef58fafce
3 changed files with 4 additions and 5 deletions
  1. 1 2
      contrl.js
  2. 1 1
      index.js
  3. 2 2
      web/index.html

+ 1 - 2
contrl.js

@@ -17,8 +17,7 @@ class ContrlService {
     async run() {
     async run() {
         // 数模初始值
         // 数模初始值
         const data = await this.Orientation()
         const data = await this.Orientation()
-        console.log(data)
-       // process.send(data);
+        process.send(data);
         await sleep(500)
         await sleep(500)
         this.run()
         this.run()
     }
     }

+ 1 - 1
index.js

@@ -64,7 +64,7 @@ class VideoServer {
       if (this.socket && this.socket.connected) {
       if (this.socket && this.socket.connected) {
         console.log('用户连接可发送', msg);
         console.log('用户连接可发送', msg);
       }
       }
-      console.log('parent get message: ' + msg);
+      console.log('contrl message: ' , msg);
     })
     })
   }
   }
 }
 }

+ 2 - 2
web/index.html

@@ -5,7 +5,7 @@
     <meta charset="UTF-8" />
     <meta charset="UTF-8" />
     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title>测试</title>
+    <title>car</title>
     <script src="./socket.io.min.js"></script>
     <script src="./socket.io.min.js"></script>
     <style>
     <style>
         video {
         video {
@@ -41,7 +41,7 @@
 
 
             RTC.ontrack = (event) => {
             RTC.ontrack = (event) => {
                 const remoteVideo = document.getElementById("v2");
                 const remoteVideo = document.getElementById("v2");
-                remoteVideo.srcObject = event.streams[0];
+                remoteVideo.srcObject = event.streams;
                 console.log("远程流|dom", event, remoteVideo);
                 console.log("远程流|dom", event, remoteVideo);
 
 
             };
             };