mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 01:49:05 +00:00
FS-9242 convert to adapter.js
This commit is contained in:
@@ -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();
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user