]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8087 #comment make $.FSRTC.validRes available globally
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 28 Aug 2015 19:11:03 +0000 (14:11 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 28 Aug 2015 19:11:03 +0000 (14:11 -0500)
html5/verto/js/src/jquery.FSRTC.js
html5/verto/video_demo/js/verto-min.js

index 34b6be0fde729fa6b290f86f4f3ac541e6f6e8d4..7fae1f65b9f9ded4c8b958fa5c86061705240f8b 100644 (file)
@@ -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) {
index 751cac0fbf9932e17550dab137eaf5e9efaea1e1..4897543d77f807475c673cc738e5ebcac9c0de82 100644 (file)
@@ -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;}