FS-9242 convert to adapter.js

This commit is contained in:
Anthony Minessale
2016-06-08 16:20:18 -05:00
parent 0e6e53f15c
commit 6d6bd1efa5
17 changed files with 4385 additions and 332 deletions

View File

@@ -4,8 +4,8 @@
angular
.module('vertoControllers')
.controller('DialPadController', ['$rootScope', '$scope',
'$http', '$location', 'toastr', 'verto', 'storage', 'CallHistory', 'eventQueue',
function($rootScope, $scope, $http, $location, toastr, verto, storage, CallHistory, eventQueue) {
'$http', '$location', 'toastr', 'verto', 'storage', 'CallHistory', 'eventQueue', '$timeout',
function($rootScope, $scope, $http, $location, toastr, verto, storage, CallHistory, eventQueue, $timeout) {
console.debug('Executing DialPadController.');
eventQueue.process();

View File

@@ -11,7 +11,10 @@
$scope.storage = storage;
console.debug('Executing PreviewController.');
var localVideo = document.getElementById('videopreview');
var volumes = document.querySelector('#mic-meter .volumes').children;
var volumes = document.querySelector('#mic-meter .volumes');
if (volumes) {
volumes = volumes.children;
}
$scope.localVideo = function() {
var constraints = {
@@ -31,10 +34,13 @@
});
};
var audioContext = null;
if (typeof AudioContext !== "undefined") {
audioContext = new AudioContext();
}
var audioContext = new AudioContext();
var mediaStreamSource = null;
var meter;
var meter = null;
var streamObj = {};
function stopMedia(stream) {
@@ -55,13 +61,12 @@
}
streamObj = stream;
localVideo.src = window.URL.createObjectURL(stream);
mediaStreamSource = audioContext.createMediaStreamSource(stream);
meter = createAudioMeter(audioContext);
mediaStreamSource.connect(meter);
renderMic();
FSRTCattachMediaStream(localVideo, stream);
if (audioContext) {
mediaStreamSource = audioContext.createMediaStreamSource(stream);
meter = createAudioMeter(audioContext);
mediaStreamSource.connect(meter);
};
}
function renderMic() {
@@ -109,8 +114,10 @@
$scope.endPreview = function() {
localVideo.src = null;
meter.shutdown();
meter.onaudioprocess = null;
if (audioContext) {
meter.shutdown();
meter.onaudioprocess = null;
};
stopMedia(streamObj);
$location.path('/dialpad');
storage.data.preview = false;

View File

@@ -33,6 +33,15 @@
});
$scope.ok = function() {
console.log('Camera Selected is', $scope.mydata.selectedVideo, $scope.verto.data.videoDevices);
angular.forEach(verto.data.videoDevices, function(video) {
console.log('checking video ', video);
if (video.id == $scope.mydata.selectedVideo) {
$scope.mydata.selectedVideoName = video.label;
console.log('Setting selectedVideoName to ', video.label);
}
})
if ($scope.mydata.selectedSpeaker != storage.data.selectedSpeaker) {
$rootScope.$emit('changedSpeaker', $scope.mydata.selectedSpeaker);
}

View File

@@ -74,7 +74,7 @@
$rootScope.$on('progress.complete', function(ev, current_progress) {
$scope.message = 'Complete';
if(verto.data.connected) {
if (storage.data.preview) {
if (0 && storage.data.preview) {
$location.path('/preview');
}
else {