Skip to content

Commit

Permalink
Rename 'mediaType' by 'mediaTypes'
Browse files Browse the repository at this point in the history
  • Loading branch information
jmillan committed Feb 3, 2013
1 parent 528d989 commit 42b3749
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/MediaSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ JsSIP.MediaSession.prototype = {
* <br> -- If the user consents, create a peerConnection.
* <br> -- If the user doesn't consent, fire onFailure callback.
*
* @param {Object} mediaType {audio:true/false, video:true/false}
* @param {Object} mediaTypes {audio:true/false, video:true/false}
* @param {Function} onSuccess
* @param {Function} onFailure
*/
startCaller: function(mediaType, onSuccess, onFailure) {
startCaller: function(mediaTypes, onSuccess, onFailure) {
var self = this;

/** @private */
Expand All @@ -53,7 +53,7 @@ JsSIP.MediaSession.prototype = {
onFailure(e);
}

this.getUserMedia(mediaType, onGetUserMediaSuccess, onGetUserMediaFailure);
this.getUserMedia(mediaTypes, onGetUserMediaSuccess, onGetUserMediaFailure);
},

/**
Expand Down Expand Up @@ -177,11 +177,11 @@ JsSIP.MediaSession.prototype = {
},

/**
* @param {Object} mediaType
* @param {Object} mediaTypes
* @param {Function} onSuccess
* @param {Function} onFailure
*/
getUserMedia: function(mediaType, onSuccess, onFailure) {
getUserMedia: function(mediaTypes, onSuccess, onFailure) {
var self = this;

function getSuccess(stream) {
Expand All @@ -204,7 +204,7 @@ JsSIP.MediaSession.prototype = {

// Get User Media
console.log(JsSIP.C.LOG_MEDIA_SESSION +"Requesting access to local media.");
navigator.webkitGetUserMedia(mediaType, getSuccess, getFailure);
navigator.webkitGetUserMedia(mediaTypes, getSuccess, getFailure);

},

Expand Down
12 changes: 6 additions & 6 deletions src/Session.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ JsSIP.Session.prototype.init_incoming = function(request) {
};

JsSIP.Session.prototype.connect = function(target, views, options) {
var event, eventHandlers, request, selfView, remoteView, mediaType, extraHeaders, requestParams;
var event, eventHandlers, request, selfView, remoteView, mediaTypes, extraHeaders, requestParams;

// Check UA Status
JsSIP.Utils.checkUAStatus(this.ua);
Expand All @@ -100,7 +100,7 @@ JsSIP.Session.prototype.connect = function(target, views, options) {
options = options || {};
selfView = views.selfView || null;
remoteView = views.remoteView || null;
mediaType = options.mediaType || {audio: true, video: true};
mediaTypes = options.mediaTypes || {audio: true, video: true};
extraHeaders = options.extraHeaders || [];
eventHandlers = options.eventHandlers || {};

Expand Down Expand Up @@ -155,7 +155,7 @@ JsSIP.Session.prototype.connect = function(target, views, options) {

this.newSession('local', request, target);
this.connecting('local', request, target);
this.sendInitialRequest(mediaType);
this.sendInitialRequest(mediaTypes);
};

/**
Expand Down Expand Up @@ -1003,7 +1003,7 @@ JsSIP.Session.prototype.sendDTMF = function(tones, options) {
/**
* @private
*/
JsSIP.Session.prototype.sendInitialRequest = function(mediaType) {
JsSIP.Session.prototype.sendInitialRequest = function(mediaTypes) {
var
self = this,
request_sender = new JsSIP.RequestSender(self, this.ua);
Expand All @@ -1019,7 +1019,7 @@ JsSIP.Session.prototype.sendInitialRequest = function(mediaType) {

// Hack to quit m=video section from sdp defined in http://code.google.com/p/webrtc/issues/detail?id=935
// To be deleted when the fix arrives to chrome stable version
if (!mediaType.video) {
if (!mediaTypes.video) {
if (self.request.body.indexOf('m=video') !== -1){
self.request.body = self.request.body.substring(0, self.request.body.indexOf('m=video'));
}
Expand All @@ -1038,7 +1038,7 @@ JsSIP.Session.prototype.sendInitialRequest = function(mediaType) {
}
}

self.mediaSession.startCaller(mediaType, onMediaSuccess, onMediaFailure);
self.mediaSession.startCaller(mediaTypes, onMediaSuccess, onMediaFailure);
};


Expand Down

0 comments on commit 42b3749

Please sign in to comment.