]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
vid screen share placeholder --args --enable-usermedia-screen-capturing --usermedia...
authorAnthony Minessale <anthm@freeswitch.org>
Sat, 6 Dec 2014 17:40:44 +0000 (11:40 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 7 Jan 2015 05:33:42 +0000 (23:33 -0600)
html5/verto/js/src/jquery.FSRTC.js

index a214c1f9db85e185d90335309dd41f3fc63fe2cd..8ca3602e0406b5774c4a961340fa8ac98241860a 100644 (file)
         return true;
     }
 
-    function onStreamError(self) {
-        console.log('There has been a problem retrieving the streams - did you allow access?');
+    function onStreamError(self, e) {
+        console.log('There has been a problem retrieving the streams - did you allow access?', e);
 
     }
 
             onStreamSuccess(self);
         }
 
-        function onError() {
-            onStreamError(self);
+        function onError(e) {
+            onStreamError(self, e);
         }
 
+
+       var audio;
+
+       if (this.options.videoParams && this.options.videoParams.chromeMediaSource == 'screen') {
+
+           this.options.videoParams = {
+               chromeMediaSource: 'screen',
+               maxWidth:screen.width,
+               maxHeight:screen.height
+           };
+
+           console.error("SCREEN SHARE");
+           audio = false;
+       } else {
+           audio = {
+               mandatory: this.options.audioParams,
+               optional: []
+           };
+       }
+
        console.log("Mandatory audio constraints", this.options.audioParams);
        console.log("Mandatory video constraints", this.options.videoParams);
 
         getUserMedia({
             constraints: {
-                audio: {
-                    mandatory: this.options.audioParams,
-                    optional: []
-                },
+               audio: audio,
                 video: this.options.useVideo ? {
                     mandatory: this.options.videoParams,
                     optional: []
             onStreamSuccess(self);
         }
 
-        function onError() {
-            onStreamError(self);
+        function onError(e) {
+            onStreamError(self, e);
         }
 
+
+       var audio;
+
+       if (this.options.videoParams && this.options.videoParams.chromeMediaSource == 'screen') {
+
+           this.options.videoParams = {
+               chromeMediaSource: 'screen',
+               maxWidth:screen.width,
+               maxHeight:screen.height
+           };
+
+           console.error("SCREEN SHARE");
+           audio = false;
+       } else {
+           audio = {
+               mandatory: this.options.audioParams,
+               optional: []
+           };
+       }
+
        console.log("Mandatory audio constraints", this.options.audioParams);
        console.log("Mandatory video constraints", this.options.videoParams);
 
+
         getUserMedia({
             constraints: {
-                audio: {
-                    mandatory: this.options.audioParams,
-                    optional: []
-                },
+                audio: audio,
                 video: this.options.useVideo ? {
                     mandatory: this.options.videoParams,
                     optional: []