Browse Source

update aframe and fix webrtc

Nikolay Suslov 4 years ago
parent
commit
12d7f4097e

+ 5 - 4
public/vwf/model/aframe/aframe-master.js

@@ -68248,7 +68248,7 @@ module.exports.Component = registerComponent('cursor', {
   },
 
   onEnterVR: function () {
-    var xrSession = this.el.xrSession;
+    var xrSession = this.el.sceneEl.xrSession;
     var self = this;
     if (!xrSession) { return; }
     WEBXR_EVENTS.DOWN.forEach(function (downEvent) {
@@ -82072,7 +82072,8 @@ if (!window.hasNativeWebXRImplementation && !window.hasNativeWebVRImplementation
   var polyfillConfig = {
     BUFFER_SCALE: bufferScale,
     CARDBOARD_UI_DISABLED: true,
-    ROTATE_INSTRUCTIONS_DISABLED: true
+    ROTATE_INSTRUCTIONS_DISABLED: true,
+    MOBILE_WAKE_LOCK: !!window.cordova
   };
   window.webvrpolyfill = new WebVRPolyfill(polyfillConfig);
 }
@@ -82098,7 +82099,7 @@ if (window.document.currentScript && window.document.currentScript.parentNode !=
 }
 
 // Error if not using a server.
-if (window.location.protocol === 'file:') {
+if (!window.cordova && window.location.protocol === 'file:') {
   error(
     'This HTML file is currently being served via the file:// protocol. ' +
     'Assets, textures, and models WILL NOT WORK due to cross-origin policy! ' +
@@ -82144,7 +82145,7 @@ _dereq_('./core/a-mixin');
 _dereq_('./extras/components/');
 _dereq_('./extras/primitives/');
 
-console.log('A-Frame Version: 1.0.4 (Date 2020-03-20, Commit #a52d7e77)');
+console.log('A-Frame Version: 1.0.4 (Date 2020-04-15, Commit #0be54ec7)');
 console.log('THREE Version (https://github.com/supermedium/three.js):',
             pkg.dependencies['super-three']);
 console.log('WebVR Polyfill Version:', pkg.dependencies['webvr-polyfill']);

File diff suppressed because it is too large
+ 0 - 0
public/vwf/model/aframe/aframe-master.js.map


File diff suppressed because it is too large
+ 0 - 0
public/vwf/model/aframe/aframe-master.min.js


File diff suppressed because it is too large
+ 0 - 0
public/vwf/model/aframe/aframe-master.min.js.map


+ 16 - 3
public/vwf/view/webrtc.js

@@ -387,6 +387,11 @@ define( [ "module", "vwf/view", "vwf/utility", "vwf/utility/color"], function( m
             let str = this.local.stream;
             if ( str ) {
               
+             
+                let videoAsset = document.querySelector('#video-avatar-' + self.kernel.moniker());
+                if (videoAsset) 
+                    videoAsset.volume = 0;
+
                 var tracks = str.getVideoTracks();
     
                 tracks.forEach(function(track) {
@@ -398,6 +403,10 @@ define( [ "module", "vwf/view", "vwf/utility", "vwf/utility/color"], function( m
         muteAudio: function ( mute ) {
             let str = this.local.stream;
             if ( str ) {
+
+                let videoAsset = document.querySelector('#video-avatar-' + self.kernel.moniker());
+                if (videoAsset) 
+                    videoAsset.volume = 0;
               
                 var tracks = str.getAudioTracks();
     
@@ -430,9 +439,12 @@ define( [ "module", "vwf/view", "vwf/utility", "vwf/utility/color"], function( m
           video.setAttribute("width", 640);
           video.setAttribute("height", 480);
 
+
           if (local) {
+           // video.muted = false;  
             video.setAttribute("muted", false);
-            video.volume = 0;
+            //video.setAttribute("volume", 0);
+            //video.volume = 0;
           } 
         
         //   let audioID = '#audio-' + id;
@@ -491,7 +503,8 @@ define( [ "module", "vwf/view", "vwf/utility", "vwf/utility/color"], function( m
 
     function displayVideo( id, stream, url, name, destMoniker, local) {
         
-        let va = createVideoElementAsAsset(name, local);
+        let assetName = 'video-avatar-'+id;
+        let va = createVideoElementAsAsset(assetName, local);
         //video.setAttribute('src', url);
         va.srcObject = stream;
 
@@ -499,7 +512,7 @@ define( [ "module", "vwf/view", "vwf/utility", "vwf/utility/color"], function( m
         //var source = audioCtx.createMediaStreamSource(stream);
         //va.audio.src = stream;
 
-        this.kernel.callMethod( 'avatar-'+id, "setVideoTexture", [name]);
+        this.kernel.callMethod( 'avatar-'+id, "setVideoTexture", [assetName]);
         
         return id;
     }

Some files were not shown because too many files changed in this diff