So i’ve posted this before but wanted to update things. When i replace the video track to the back camera on iphone the camera switches but the audio input stops working.
So i tried to also replace the audio track with the microphone it was originally using (there is only one the phone) but when i do that the input works but echos back through the publisher video.
Baring in mind i am subscribing to the publisher to see themselves, it’s almost as though the audio on the video for the publisher seeing themselves becomes unmuted. I tried another fix to mute the publisher video but it doesn’t work
I am yet. find a solution.
UPDATE
So to replace the track:
this.OVPublisher.replaceTrack(audioTrack).then(() => {
console.log("AUDIO TRACK REPLACED")
this.OVPublisher.videoReference.setAttribute('muted',true);
this.OVPublisher.videoReference.muted = true;
}).catch(()=>{
this.toast.error('There was a problem activating your microphone.');
})
Even with telling the video reference to mute it still echos. If i take this out and just replace the video track to switch camera, there is no sound input at all anymore, even switching the camera back to the original there is then no sound input.
UPDATE 2
I’ve just noticed this on the publisher video tag:
id="local-video-undefined"
Could this be the issue? It can’t find the video reference because it hasn’t got the stream id, it says undefined? Why is it undefined?
So to create the publisher i contact the server (php) and make a new session with vidu via the REST api and return the publisher token, then connect on the front end:
this.OVSession.connect(publisherToken)