Skip to content

Commit

Permalink
Merge pull request #2028 from twilio/prep-2-28-1
Browse files Browse the repository at this point in the history
Prep for 2.28.1
  • Loading branch information
manjeshbhargav authored Oct 3, 2023
2 parents 8050ae8 + 0f6efd2 commit 057dfcf
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
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

0 comments on commit 057dfcf

Please sign in to comment.