Advertisement
Guest User

Untitled

a guest
Oct 14th, 2016
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var getVideoSourceList = function(){
  2.  
  3.       var deferred = $q.defer();
  4.       var videoSourcesList = [];
  5.  
  6.       easyrtc.getVideoSourceList(function(list) {
  7.        
  8.         if(list.length > 0){
  9.           for(var i=0; i < list.length; i++){
  10.             var source = {};
  11.             source.label = list[i].label;
  12.             source.id = list[i].id;
  13.  
  14.             if(list[i].label.indexOf('back') > -1){
  15.               source.cameraType = 'BACK_CAMERA';
  16.             }
  17.             else{
  18.               source.cameraType = 'FRONT_CAMERA';
  19.             }
  20.             videoSourcesList.push(source);
  21.           }
  22.         }
  23.         deferred.resolve(videoSourcesList);
  24.  
  25.  
  26.       });
  27.       return deferred.promise;
  28.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement