3

Does anyone know why the addstream event doesn't work when firefox is out of focus or minimized? im using jssip 3.2 library. In chrome this does not happen and the event callback is executed with chrome being minimized or without the need to have the tab in question in focus. Even when the tab with the code in firefox has the focus, the event is triggered without problems. I work in a program in which calls are answered automatically. When there is an incoming call in chrome the user must not do anything for it to start listening to the caller's audio.

I have the corresponding permissions enabled in firefox (automatic audio, microphone, etc.)

I tried to try different settings in about:config without success. i have tried to try different versions of firefox without success.

thank you in advance for your help.

Part of the code:

<!-- ... -->
<audio id="audio_remote" autoplay="autoplay"></audio>
  <!-- ... -->

  <script>
    var remoteAudio = document.getElementById("audio_remote");

    // ...

    var callOptions = {
      mediaConstraints: { audio: true, video: false },
      rtcOfferConstraints: {
        offerToReceiveAudio: 1,
        offerToReceiveVideo: 0,
        googIPv6: false,
      },
    };

    phone.on("newRTCSession", function (e) {
      var session = e.session;

      // ...

      if (session.direction === "incoming") {
        session.answer(callOptions);

        // this event is not fired in firefox non-focused or minimized 
        session.connection.addEventListener("addstream", function (e) {
          audio_remote.src = window.URL.createObjectURL(e.stream);
          audio_remote.play();
          console.log("addstream ok!");
        });
      }

      // ...
    });
  </script>

0 Answers0