FS-8087 #comment make $.FSRTC.validRes available globally
This commit is contained in:
parent
35e503b72a
commit
8a1b75d1db
|
@ -62,7 +62,7 @@ var iceTimer;
|
|||
var result = sdpLine.match(pattern);
|
||||
return (result && result.length == 2) ? result[1] : null;
|
||||
}
|
||||
|
||||
|
||||
// Returns a new m= line with the specified codec as the first one.
|
||||
function setDefaultCodec(mLine, payload) {
|
||||
var elements = mLine.split(' ');
|
||||
|
@ -129,6 +129,8 @@ var iceTimer;
|
|||
checkCompat();
|
||||
};
|
||||
|
||||
$.FSRTC.validRes = [];
|
||||
|
||||
$.FSRTC.prototype.useVideo = function(obj, local) {
|
||||
var self = this;
|
||||
|
||||
|
@ -512,8 +514,6 @@ var iceTimer;
|
|||
return {audio: audio, video: video, useVideo: useVideo};
|
||||
}
|
||||
|
||||
|
||||
|
||||
$.FSRTC.prototype.call = function(profile) {
|
||||
checkCompat();
|
||||
|
||||
|
@ -1021,8 +1021,6 @@ var iceTimer;
|
|||
return media;
|
||||
}
|
||||
|
||||
$.FSRTC.validRes = [];
|
||||
|
||||
$.FSRTC.resSupported = function(w, h) {
|
||||
for (var i in $.FSRTC.validRes) {
|
||||
if ($.FSRTC.validRes[i][0] == w && $.FSRTC.validRes[i][1] == h) {
|
||||
|
|
|
@ -27,9 +27,9 @@ function onRemoteStream(self,stream){if(self.options.useVideo){self.options.useV
|
|||
var element=self.options.useAudio;console.log("REMOTE STREAM",stream,element);if(typeof element.srcObject!=='undefined'){element.srcObject=stream;}else if(typeof element.mozSrcObject!=='undefined'){element.mozSrcObject=stream;}else if(typeof element.src!=='undefined'){element.src=URL.createObjectURL(stream);}else{console.error('Error attaching stream to element.');}
|
||||
self.options.useAudio.play();self.remoteStream=stream;}
|
||||
function onOfferSDP(self,sdp){self.mediaData.SDP=self.stereoHack(sdp.sdp);console.log("Offer SDP");doCallback(self,"onOfferSDP");}
|
||||
$.FSRTC.prototype.answer=function(sdp,onSuccess,onError){this.peer.addAnswerSDP({type:"answer",sdp:sdp},onSuccess,onError);};$.FSRTC.prototype.stop=function(){var self=this;if(self.options.useVideo){self.options.useVideo.style.display='none';self.options.useVideo[moz?'mozSrcObject':'src']=null;}
|
||||
$.FSRTC.prototype.answer=function(sdp,onSuccess,onError){this.peer.addAnswerSDP({type:"answer",sdp:sdp},onSuccess,onError);};$.FSRTC.prototype.stop=function(){var self=this;if(self.options.useVideo){self.options.useVideo.style.display='none';if(moz){self.options.useVideo['mozSrcObject']=null;}else{self.options.useVideo['src']='';}}
|
||||
if(self.localStream){self.localStream.stop();self.localStream=null;}
|
||||
if(self.options.localVideo){self.options.localVideo.style.display='none';self.options.localVideo[moz?'mozSrcObject':'src']=null;}
|
||||
if(self.options.localVideo){self.options.localVideo.style.display='none';if(moz){self.options.localVideo['mozSrcObject']=null;}else{self.options.localVideo['src']='';}}
|
||||
if(self.options.localVideoStream){self.options.localVideoStream.stop();}
|
||||
if(self.peer){console.log("stopping peer");self.peer.stop();}};$.FSRTC.prototype.getMute=function(){var self=this;return self.enabled;}
|
||||
$.FSRTC.prototype.setMute=function(what){var self=this;var audioTracks=self.localStream.getAudioTracks();for(var i=0,len=audioTracks.length;i<len;i++){switch(what){case"on":audioTracks[i].enabled=true;break;case"off":audioTracks[i].enabled=false;break;case"toggle":audioTracks[i].enabled=!audioTracks[i].enabled;default:break;}
|
||||
|
|
Loading…
Reference in New Issue