retain localAudio + localVideo when re-establishing a connection. fixes a bug report by markus kilas

This commit is contained in:
Philipp Hancke 2014-09-02 21:11:54 +02:00
parent ca0f006b4e
commit df9ac36aa0
1 changed files with 7 additions and 0 deletions

7
app.js
View File

@ -92,6 +92,11 @@ function init() {
}
function connect(jid, password) {
var localAudio, localVideo;
if (connection && connection.jingle) {
localAudio = connection.jingle.localAudio;
localVideo = connection.jingle.localVideo;
}
connection = new Strophe.Connection(document.getElementById('boshURL').value || config.bosh || '/http-bind');
if (nickname) {
@ -107,6 +112,8 @@ function connect(jid, password) {
if (!connection.jingle.pc_constraints.optional) connection.jingle.pc_constraints.optional = [];
connection.jingle.pc_constraints.optional.push({googIPv6: true});
}
if (localAudio) connection.jingle.localAudio = localAudio;
if (localVideo) connection.jingle.localVideo = localVideo;
if(!password)
password = document.getElementById('password').value;