Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prep for 2.28.1 #2028

Merged
merged 4 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ The Twilio Programmable Video SDKs use [Semantic Versioning](http://www.semver.o

**Version 1.x reached End of Life on September 8th, 2021.** See the changelog entry [here](https://www.twilio.com/changelog/end-of-life-complete-for-unsupported-versions-of-the-programmable-video-sdk). Support for the 1.x version ended on December 4th, 2020.

2.28.1 (October 3, 2023)
========================

Bug Fixes
---------

- Previously, a Chrome iOS 17 Participant's local audio (Krisp noise cancellation enabled) did not recover after foregrounding the browser following the playing of a YouTube video (or some other application which requires microphone permissions). We work around this by permanently disabling the Krisp noise cancellation upon foregrounding the browser. (VIDEO-13006)

2.28.0 (September 14, 2023)
===========================

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Releases of twilio-video.js are hosted on a CDN, and you can include these
directly in your web app using a <script> tag.

```html
<script src="//sdk.twilio.com/js/video/releases/2.28.0/twilio-video.min.js"></script>
<script src="//sdk.twilio.com/js/video/releases/2.28.1/twilio-video.min.js"></script>
```

Using this method, twilio-video.js will set a browser global:
Expand Down
28 changes: 27 additions & 1 deletion lib/media/track/localaudiotrack.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use strict';

const { isIOS } = require('../../util/browserdetection');
const detectSilentAudio = require('../../util/detectsilentaudio');
const { isIOSChrome } = require('../../webrtc/util');
const AudioTrack = require('./audiotrack');
const mixinLocalMediaTrack = require('./localmediatrack');

Expand Down Expand Up @@ -162,7 +164,7 @@ class LocalAudioTrack extends LocalMediaAudioTrack {
/**
* @private
*/
_reacquireTrack(constraints) {
_reacquireTrack(constraints) {
this._log.debug('_reacquireTrack: ', constraints);
if (this.noiseCancellation) {
return this.noiseCancellation.reacquireTrack(() => {
Expand All @@ -188,6 +190,30 @@ class LocalAudioTrack extends LocalMediaAudioTrack {
});
}

/**
* NOTE(mmalavalli): On iOS 17 Chrome, a LocalAudioTrack with Krisp Noise Cancellation
* enabled that is restarted due to foregrounding the browser is silent for as-of-yet
* unknown reason. We work around this by discarding the Krisp MediaStreamTrack and using
* the source MediaStreamTrack. (VIDEO-13006)
* @private
*/
_setMediaStreamTrack(mediaStreamTrack) {
const { _log: log, noiseCancellation } = this;
let promise = super._setMediaStreamTrack.call(this, mediaStreamTrack);

if (isIOSChrome() && !!noiseCancellation) {
log.debug('iOS Chrome detected, checking if the restarted Krisp audio is silent');
promise = promise.then(() => detectSilentAudio(this._dummyEl)).then(isSilent => {
log.debug(`Krisp audio is ${isSilent ? 'silent, using source audio' : 'not silent'}`);
return isSilent && noiseCancellation.disablePermanently().then(() => {
return super._setMediaStreamTrack.call(this, noiseCancellation.sourceTrack);
});
});
}

return promise;
}

/**
* Disable the {@link LocalAudioTrack}. This is equivalent to muting the audio source.
* @returns {this}
Expand Down