Nikolay Suslov преди 7 години
родител
ревизия
f9d7184674

+ 0 - 24
public/webrtc/appui.js

@@ -58,30 +58,6 @@ function createApp() {
                                        
                                     }
     
-                                },
-                                {
-                                    $cell: true,
-                                    $type: "button",
-                                    class: "mdc-button mdc-button--raised",
-                                    $text: "Off",
-                                    onclick: function (e) {
-                                        let avatarID = 'avatar-'+vwf.moniker_;
-                                        vwf_view.kernel.callMethod(avatarID, "webrtcTurnOnOff", [false]);
-                                       
-                                    }
-    
-                                },
-                                {
-                                    $cell: true,
-                                    $type: "button",
-                                    class: "mdc-button mdc-button--raised",
-                                    $text: "On",
-                                    onclick: function (e) {
-                                        let avatarID = 'avatar-'+vwf.moniker_;
-                                        vwf_view.kernel.callMethod(avatarID, "webrtcTurnOnOff", [true]);
-                                       
-                                    }
-    
                                 }
     
     

+ 0 - 19
support/client/lib/vwf/model/aframe/addon/aframe-components.js

@@ -454,25 +454,6 @@ AFRAME.registerComponent('gearvrcontrol', {
                    }
                 }
                   }
-                 
-
-                // console.log(this.el);
-
-                // let assets = document.querySelector('a-assets');
-                // let driver = vwf.views["vwf/view/webrtc"];
-                // if (driver) { 
-                //     let stream = driver.local.stream;
-                //     console.log(driver.local.stream);
-                //     console.log(this.el.sceneEl.audioListener)
-                //     let sound = this.el.components.sound;
-                //     console.log(self.sound);
-                   // let audioContext = sound.listener.context;
-                    //var source = audioContext.createMediaStreamSource(stream);
-                
-               // var audioCtx = new AudioContext();
-              //  var source = audioCtx.createMediaStreamSource(stream);
-
-              //  }
 
             },
 

+ 33 - 0
support/client/lib/vwf/view/editor-new.js

@@ -348,6 +348,39 @@ define([
 
 
                                     ]
+                                },
+                                {
+                                    $cell: true,
+                                    $type: "div",
+                                    class: "mdc-layout-grid__cell mdc-layout-grid__cell--span-12",
+                                    $components: [
+                                        {
+                                            $cell: true,
+                                            $type: "button",
+                                            class: "mdc-button mdc-button--raised",
+                                            $text: "Wide",
+                                            onclick: function (e) {
+                                                let avatarID = 'avatar-'+vwf.moniker_;
+                                                vwf_view.kernel.callMethod(avatarID, "setBigVideoHead", []);
+                                               
+                                            }
+            
+                                        },
+                                        {
+                                            $cell: true,
+                                            $type: "button",
+                                            class: "mdc-button mdc-button--raised",
+                                            $text: "Small",
+                                            onclick: function (e) {
+                                                let avatarID = 'avatar-'+vwf.moniker_;
+                                                vwf_view.kernel.callMethod(avatarID, "setSmallVideoHead", []);
+                                               
+                                            }
+            
+                                        }
+
+                                    ]
+
                                 }
                             ]
                         }

+ 17 - 15
support/client/lib/vwf/view/webrtc.js

@@ -183,6 +183,8 @@ define( [ "module", "vwf/view", "vwf/utility", "vwf/utility/color", "jquery" ],
 
                 this.deleteConnection(nodeID);
                 this.kernel.callMethod(nodeID, "removeSoundWebRTC");
+                this.kernel.callMethod(nodeID, "removeVideoTexture");
+                
             }
 
         },
@@ -437,13 +439,12 @@ define( [ "module", "vwf/view", "vwf/utility", "vwf/utility/color", "jquery" ],
 
           if (local) video.setAttribute("muted", true);
         
-          let audioID = '#audio-' + id;
-          var audio = document.querySelector(audioID);
-          if (!audio) {
-            audio = document.createElement('audio');
-          }
-          audio.setAttribute('id', audioID);
-          //<audio id="river" src="river.mp3" preload="auto"></audio>
+        //   let audioID = '#audio-' + id;
+        //   var audio = document.querySelector(audioID);
+        //   if (!audio) {
+        //     audio = document.createElement('audio');
+        //   }
+        //   audio.setAttribute('id', audioID);
 
           var assets = document.querySelector('a-assets');
         
@@ -456,11 +457,11 @@ define( [ "module", "vwf/view", "vwf/utility", "vwf/utility/color", "jquery" ],
             assets.appendChild(video);
           }
         
-          if (!assets.contains(audio)) {
-            assets.appendChild(audio);
-          }
+        //   if (!assets.contains(audio)) {
+        //     assets.appendChild(audio);
+        //   }
 
-          return {'video': video, 'audio': audio};
+          return video //{'video': video, 'audio': audio};
         }
 
 
@@ -496,17 +497,14 @@ define( [ "module", "vwf/view", "vwf/utility", "vwf/utility/color", "jquery" ],
         
         let va = createVideoElementAsAsset(name, local);
         //video.setAttribute('src', url);
-        va.video.srcObject = stream;
+        va.srcObject = stream;
 
         //var audioCtx = new AudioContext();
         //var source = audioCtx.createMediaStreamSource(stream);
         //va.audio.src = stream;
 
-        let audioID = 'audio-' + name;
         this.kernel.callMethod( 'avatar-'+id, "setVideoTexture", [name]);
-        this.kernel.callMethod( 'avatar-'+id, "setSoundWebRTC", [audioID]);
         
-
         return id;
     }
 
@@ -525,6 +523,10 @@ define( [ "module", "vwf/view", "vwf/utility", "vwf/utility/color", "jquery" ],
     }
 
     function displayRemote( id, stream, url, name, destMoniker, color ) {
+
+        let audioID = 'audio-' + name;
+        this.kernel.callMethod( 'avatar-'+id, "setSoundWebRTC", [audioID]);
+
         return displayVideo.call( this, id, stream, url, name, destMoniker, true );
     }
 

+ 9 - 1
support/proxy/vwf.example.com/aframe/avatar.js

@@ -320,15 +320,23 @@ this.setVideoTexture = function(val){
     this.avatarNode.myHead.visual.src = '#'+val;
 }
 
+this.removeVideoTexture = function(){
+   // this.setSmallVideoHead();
+    this.avatarNode.myHead.visual.color = this.avatarNode.myBody.color;
+    this.avatarNode.myHead.visual.src = "";
+    // this.avatarNode.myHead.visual.src = '#'+val;
+}
+
 this.removeSoundWebRTC = function(){
 
+    if (this.avatarNode.audio)
     this.avatarNode.children.delete(this.avatarNode.audio);
 }
 
 this.setSoundWebRTC = function(val){
     console.log(val);
     if (this.avatarNode.audio) this.removeSoundWebRTC();
-    
+
     var soundNode = {
         "extends": "http://vwf.example.com/aframe/aentity.vwf",
         "properties": {

+ 1 - 0
support/proxy/vwf.example.com/aframe/avatar.vwf.yaml

@@ -44,5 +44,6 @@ methods:
          parameters:
             - val
     removeSoundWebRTC:
+    removeVideoTexture:
 scripts:
 - source: "http://vwf.example.com/aframe/avatar.js"