Procházet zdrojové kódy

head video size props

Nikolay Suslov před 7 roky
rodič
revize
3ace630df3

+ 70 - 3
public/webrtc/appui.js

@@ -1,5 +1,72 @@
 //-----App ui-----
 
-// function createApp() {
-//     return {}
-// }
+function createApp() {
+    
+        let self = this
+    
+    
+    
+        function makeSetter(val) {
+            let setstr = 'this.' + val + '= value; this.redrawEvent();'
+            return setstr
+        }
+    
+        function getNewPosition() {
+            //let allChild = vwf.find("","/*")
+            let cursorVisID = vwf.find("myCursor-avatar-" + vwf.moniker_, "./vis")[0]
+            let avPos = AFRAME.utils.coordinates.parse(vwf.getProperty(cursorVisID, 'worldPosition'));
+            let newPos = [avPos.x, avPos.y, avPos.z]
+            return newPos
+        }
+    
+        return {
+            $cell: true,
+            $type: "div",
+            class: "propGrid max-width mdc-layout-grid mdc-layout-grid--align-left",
+            $components: [
+                {
+                    $cell: true,
+                    $type: "div",
+                    class: "mdc-layout-grid__inner",
+                    $components: [
+                        {
+                            $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", []);
+                                       
+                                    }
+    
+                                }
+    
+    
+                            ]
+                        }
+
+                    ]
+                }
+            ]
+        }
+    }
+    

+ 13 - 0
support/proxy/vwf.example.com/aframe/avatar.js

@@ -298,8 +298,21 @@ this.showHideCursor = function(bool){
     this.avatarNode.myHead.myCursor.properties.visible = bool;
 }
 
+this.setBigVideoHead = function(val){
+    this.avatarNode.myHead.visual.height = 4;
+    this.avatarNode.myHead.visual.width = 3;
+    this.avatarNode.myBody.visible = false;
+}
+
+this.setSmallVideoHead = function(val){
+    this.avatarNode.myHead.visual.height = 0.5;
+    this.avatarNode.myHead.visual.width = 0.5;
+    this.avatarNode.myBody.visible = true;
+}
+
 this.setVideoTexture = function(val){
     console.log(val);
+    this.setSmallVideoHead();
     this.avatarNode.myHead.visual.color = "white";
     this.avatarNode.myHead.visual.src = '#temp';
     this.avatarNode.myHead.visual.src = '#'+val;

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

@@ -24,6 +24,8 @@ methods:
         parameters:
             - position
             - rotation
+    setSmallVideoHead:
+    setBigVideoHead:
     setVideoTexture:
         parameters:
             - val