Skip to content

Commit

Permalink
Move third_party under src/ and update adapter.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiayang Liu committed Feb 3, 2015
1 parent 6644b0e commit f971ad9
Show file tree
Hide file tree
Showing 33 changed files with 10 additions and 18 deletions.
3 changes: 0 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ module.exports = function(grunt) {
src: 'src/**/*.js',
options: {
preset: 'google', // as per Google style guide – could use '.jscsrc' instead
'excludeFiles': [
'src/js/adapter.js'
],
requireCurlyBraces: ['if']
}
},
Expand Down
25 changes: 10 additions & 15 deletions src/js/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@ function trace(text) {
}
}

function maybeFixConfiguration(pcConfig) {
if (!pcConfig) {
return;
}
for (var i = 0; i < pcConfig.iceServers.length; i++) {
if (pcConfig.iceServers[i].hasOwnProperty('urls')) {
pcConfig.iceServers[i].url = pcConfig.iceServers[i].urls;
delete pcConfig.iceServers[i].urls;
}
}
}

if (navigator.mozGetUserMedia) {
console.log('This appears to be Firefox');

Expand All @@ -56,7 +44,14 @@ if (navigator.mozGetUserMedia) {
// The RTCPeerConnection object.
RTCPeerConnection = function(pcConfig, pcConstraints) {
// .urls is not supported in FF yet.
maybeFixConfiguration(pcConfig);
if (pcConfig && pcConfig.iceServers) {
for (var i = 0; i < pcConfig.iceServers.length; i++) {
if (pcConfig.iceServers[i].hasOwnProperty('urls')) {
pcConfig.iceServers[i].url = pcConfig.iceServers[i].urls;
delete pcConfig.iceServers[i].urls;
}
}
}
return new mozRTCPeerConnection(pcConfig, pcConstraints);
};

Expand All @@ -75,8 +70,8 @@ if (navigator.mozGetUserMedia) {
MediaStreamTrack.getSources = function(successCb) {
setTimeout(function() {
var infos = [
{ kind: 'audio', id: 'default', label:'', facing:'' },
{ kind: 'video', id: 'default', label:'', facing:'' }
{kind: 'audio', id: 'default', label:'', facing:''},
{kind: 'video', id: 'default', label:'', facing:''}
];
successCb(infos);
}, 0);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f971ad9

Please sign in to comment.