]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8563 [verto_communicator] - Added callback to setAudioPlaybackDevice
authorJaon EarlWolf <jamonsterr@gmail.com>
Mon, 21 Dec 2015 20:59:59 +0000 (17:59 -0300)
committerJaon EarlWolf <jamonsterr@gmail.com>
Mon, 21 Dec 2015 20:59:59 +0000 (17:59 -0300)
html5/verto/verto_communicator/src/css/verto.css
html5/verto/verto_communicator/src/partials/modal_settings.html
html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js
html5/verto/verto_communicator/src/vertoControllers/controllers/ModalSettingsController.js

index 4da5f19cc134e9f6fd9c2b91577d86f70cceff17..aa9157436a4268818b41f9c4d43d9fb08131d69c 100644 (file)
@@ -1679,6 +1679,11 @@ body:-webkit-full-screen #incall .video-footer {
   animation: growY .2s reverse;
 }
 
+.unsupported {
+  color: grey;
+  font-size: 10px;
+}
+
 @keyframes growY {
   from { max-height:2000px;}
   to { max-height:0px;}
index 4cb666fbbb787dd32b815390f70aee205e5964a8..c7c4470d4a9818b662418f33cb848c2e3d791dd2 100644 (file)
   </div>
 
   <div class="form-group">
-    <label for="settings-microphone">Speaker:</label>
-    <select name="microphone" id="settings-microphone" class="form-control"
+    <label for="settings-microphone">
+      Speaker:
+      <span ng-show="!speakerFeature" class="unsupported">
+        Your browser doesn't seem to support this feature
+      </span>
+    </label>
+    <select name="microphone" id="settings-microphone" class="form-control" ng-disabled="!speakerFeature"
             ng-model="mydata.selectedSpeaker" ng-options="item.id as item.label for item in verto.data.speakerDevices">
     </select>
   </div>
index 5f965a2a7464f31581ecf8ac49a08d6726ca7add..6094e5052fba840ec6ac9cb703aa47c528e08dca 100644 (file)
       });
 
       $rootScope.$on('changedSpeaker', function(event, speakerId) {
-        // This should provide feedback
-       //setAudioPlaybackDevice(<id>[,<callback>[,<callback arg>]]);
-       // if callback is set it will be called as callback(<bool success/fail>, <device name>, <arg if you supplied it>)
-        verto.data.call.setAudioPlaybackDevice(speakerId);
+        if (verto.data.call) {
+          verto.data.call.setAudioPlaybackDevice(speakerId, sinkIdCallback);
+        }
       });
 
       /**
           });
       };
 
+      function sinkIdCallback(success, deviceName) {
+        if (success) {
+          toastr.info('Speaker is now <span class="install">' + deviceName + '</a>', 'Success', { allowHtml: true });
+        } else {
+          toastr.error('Your browser doesn\'t seem to support this feature', 'Error');
+        }
+      }
 
     }
   );
index a8259ddc951b2c73d8f9934ae78832aec793ba60..c1665eacca6c93ecf400463bf64a4c2fdc2abeb1 100644 (file)
@@ -12,6 +12,8 @@
         $scope.verto = verto;
         $scope.mydata = angular.copy(storage.data);
 
+        $scope.speakerFeature = typeof document.getElementById('webcam').sinkId !== 'undefined';
+
         $scope.ok = function() {
           if ($scope.mydata.selectedSpeaker != storage.data.selectedSpeaker) {
             $rootScope.$emit('changedSpeaker', $scope.mydata.selectedSpeaker);