0

With the recent release of Firefox Version 58, I have encountered a no audio issue using sipML5, I suspect it has to do with the change they did where they completely removed mozSrcObejct and they recommend to use SrcObeject instead:

The prefixed version of HTMLMediaElement.srcObject has been removed; make sure code is updated to use the standard srcObject instead of mozSrcObject (bug 1183495).

I'm using the SIPml-api.js from doubango and there I see that they use this property in these two functions:

attachMediaStream = function (a, b) {
    console.log("Attaching media stream");
    a.mozSrcObject = b;
    a.play();
    return a
};
reattachMediaStream = function (b, a) {
    console.log("Reattaching media stream");
    b.mozSrcObject = a.mozSrcObject;
    b.play()
}

My question would be, how can I replace the prefixed mozsrcObject to use the standard srcObject, I tried just eliminating he prefix but that didn't work, any help would be appreciated.

Note that with Firefox version the original js from sipML5 works without a problem, and the console logs and webrtc logs looks the same.

  • Using `a.srcObject` instead of `a.mozSrcObject` is definitely the way to go. Have a look at the [various](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement#Browser_compatibility) [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/srcObject) pages to get usage examples. Moreover, if it's not working with `srcObject`, post the relevant code section along with the errors you're getting. – Dexter Feb 06 '18 at 08:08
  • Yes, that seems to did the trick, I was using SrcObject instead of srcObject, and that's why it didn't work at the first time, thank you – Yasser Gutierrez Feb 07 '18 at 17:32

2 Answers2

0

All I had to do was replace a.srcObject instead of a.mozSrcObject and it worked now with Firefox 58

0

I also trying to make sipml5 working with firefox 58. Audio and Video both are not working. As per the suggestion, I changed srcObject but it did not make any difference. Still no audio and video.

// Attach a media stream to an element.
  attachMediaStream = function(element, stream) {
    console.log("Attaching media stream");
    element.srcObject = stream;
    element.play();
    return element;
  };

  reattachMediaStream = function(to, from) {
    console.log("Reattaching media stream");
    to.srcObject = from.srcObject;
    to.play();
  };

I found people are suggesting to use navigator.mediaDevices.getUserMedia in place of navigator.mozGetUserMedia as navigator.mediaDevices has now become common for all the browsers. But when we change it, simpl5 stops working.

Is there any other way to look around to fix the issue?