Просмотр исходного кода

fix(JitsiLocalTrack): no data event fired before ICE connected

We can not assume that the audio source is not sending any data based
on the stat until the media connection has not been established.
dev1
paweldomas 9 лет назад
Родитель
Сommit
1f6e2ac9fe
1 измененных файлов: 6 добавлений и 1 удалений
  1. 6
    1
      modules/RTC/JitsiLocalTrack.js

+ 6
- 1
modules/RTC/JitsiLocalTrack.js Просмотреть файл

536
  */
536
  */
537
 JitsiLocalTrack.prototype._setByteSent = function (bytesSent) {
537
 JitsiLocalTrack.prototype._setByteSent = function (bytesSent) {
538
     this._bytesSent = bytesSent;
538
     this._bytesSent = bytesSent;
539
-    if(this._testByteSent) {
539
+    // FIXME it's a shame that PeerConnection and ICE status does not belong
540
+    // to the RTC module and it has to be accessed through
541
+    // the conference(and through the XMPP chat room ???) instead
542
+    let iceConnectionState
543
+        = this.conference ? this.conference.getConnectionState() : null;
544
+    if(this._testByteSent && "connected" === iceConnectionState) {
540
         setTimeout(function () {
545
         setTimeout(function () {
541
             if(this._bytesSent <= 0){
546
             if(this._bytesSent <= 0){
542
                 //we are not receiving anything from the microphone
547
                 //we are not receiving anything from the microphone

Загрузка…
Отмена
Сохранить