Fixes error when simulcast is disabled.

This commit is contained in:
George Politis 2014-10-20 14:40:37 +02:00
parent 774785c648
commit 65ddc22112
2 changed files with 24 additions and 23 deletions

View File

@ -11,7 +11,7 @@
<meta itemprop="image" content="/images/jitsilogo.png"/>
<script src="libs/jquery-2.1.1.min.js"></script>
<script src="config.js?v=5"></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
<script src="simulcast.js?v=4"></script><!-- simulcast handling -->
<script src="simulcast.js?v=5"></script><!-- simulcast handling -->
<script src="libs/strophe/strophe.jingle.adapter.js?v=2"></script><!-- strophe.jingle bundles -->
<script src="libs/strophe/strophe.min.js?v=1"></script>
<script src="libs/strophe/strophe.disco.min.js?v=1"></script>

View File

@ -934,6 +934,29 @@ function SimulcastManager() {
// Create remote simulcast.
this.simulcastReceiver = new SimulcastReceiver(this.simulcastUtils);
// Initialize local simulcast.
// TODO(gp) move into SimulcastManager.prototype.getUserMedia and take into
// account constraints.
if (!config.enableSimulcast) {
this.simulcastSender = new NoSimulcastSender();
} else {
var isChromium = window.chrome,
vendorName = window.navigator.vendor;
if(isChromium !== null && isChromium !== undefined && vendorName === "Google Inc.") {
var ver = parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10);
if (ver > 37) {
this.simulcastSender = new NativeSimulcastSender();
} else {
this.simulcastSender = new NoSimulcastSender();
}
} else {
this.simulcastSender = new NoSimulcastSender();
}
}
}
/**
@ -1010,28 +1033,6 @@ SimulcastManager.prototype.getLocalVideoStream = function() {
*/
SimulcastManager.prototype.getUserMedia = function (constraints, success, err) {
// Initialize local simulcast.
// TODO(gp) take into account constraints.
if (!config.enableSimulcast) {
this.simulcastSender = new NoSimulcastSender();
} else {
var isChromium = window.chrome,
vendorName = window.navigator.vendor;
if(isChromium !== null && isChromium !== undefined && vendorName === "Google Inc.") {
var ver = parseInt(window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10);
if (ver > 37) {
this.simulcastSender = new NativeSimulcastSender();
} else {
this.simulcastSender = new NoSimulcastSender();
}
} else {
this.simulcastSender = new NoSimulcastSender();
}
}
this.simulcastSender.getUserMedia(constraints, success, err);
};