Hugo H
Hugo H

Reputation: 6362

Cordova track.stop() not releasing "In-Call" volume mode

I have an issue with sound output on android (Galaxy S7 edge + crosswalk):

Before my call when I try to change the sound I can set the "ringtone" volume:

Before call, I can change Ringtone volume

Then I'm starting a webrtc audio call with

const constraints = {
  video: false,
  audio: true,
};

navigator.mediaDevices.getUserMedia(constraints)
                      .then(stream => this.stream = stream)

I can change the call volume by pressing the volume buttons:

During call volume can be changed

Then I'm ending it by calling

this.stream.getTracks().forEach((track) => {
   track.stop();
});

But the sound is still "In-Call" :

After call volume is still In-Call

When I close the app, I can change ringtone again...

What's wrong?

Upvotes: 1

Views: 155

Answers (1)

Mital Joshi
Mital Joshi

Reputation: 1202

There is no issue in your 'ending' code. Just make sure navigator.mediaDevices.getUserMedia called only once or all tracks stopped before it called again.

Upvotes: 0

Related Questions