2.6.0 (June 26, 2020)
Changes
- Worked around this iOS Safari bug which causes your
application to lose the microphone when another application (Siri, YouTube, FaceTime, etc.) reserves the
microphone. Now your application will regain the microphone after foregrounding. As a result of this, the
LocalAudioTrack'smediaStreamTrack
property will now point to the newly acquired MediaStreamTrack, and
thestarted
event is fired again on the LocalAudioTrack. Theid
of the LocalAudioTrack is now no longer
guaranteed to be equal to theid
of the MediaStreamTrack. Also, if you want to listen to events on the
MediaStreamTrack, we recommend that you do so in thestarted
event handler, since it guarantees that you
are always listening to events on the most recently acquired MediaStreamTrack. (JSDK-2828)
const { createLocalAudioTrack } = require('twilio-video');
const localAudioTrack = await createLocalAudioTrack();
function onMute() {
console.log('MediaStreamTrack muted!');
}
function onUnmute() {
console.log('MediaStreamTrack unmuted!');
}
localAudioTrack.on('started', () => {
const { mediaStreamTrack } = localAudioTrack;
mediaStreamTrack.addEventListener('mute', onMute);
mediaStreamTrack.addEventListener('unmute', onUnmute);
});
localAudioTrack.on('stopped', () => {
const { mediaStreamTrack } = localAudioTrack;
mediaStreamTrack.removeEventListener('mute', onMute);
mediaStreamTrack.removeEventListener('unmute', onUnmute);
});
- Worked around iOS Safari bug where, when the application is foregrounded,
it sometimes does not resume playback of the HTMLMediaElements attached to RemoteTracks that are paused when the application
was backgrounded (JSDK-2879).