Skip to content

Commit

Permalink
openvidu-browser: typed OpenViduAdvancedConfiguration#publisherSpeaki…
Browse files Browse the repository at this point in the history
…ngEventsOptions
  • Loading branch information
pabloFuente committed May 27, 2021
1 parent 7895ac0 commit d320da6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion openvidu-browser/src/OpenVidu/StreamManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ export class StreamManager extends EventDispatcher {
* - `interval`: (number) how frequently the analyser polls the audio stream to check if speaking has started/stopped or audio volume has changed. Default **100** (ms)
* - `threshold`: (number) the volume at which _publisherStartSpeaking_, _publisherStopSpeaking_ events will be fired. Default **-50** (dB)
*/
updatePublisherSpeakingEventsOptions(publisherSpeakingEventsOptions): void {
updatePublisherSpeakingEventsOptions(publisherSpeakingEventsOptions: { interval?: number, threshold?: number }): void {
const currentHarkOptions = !!this.stream.harkOptions ? this.stream.harkOptions : (this.stream.session.openvidu.advancedConfiguration.publisherSpeakingEventsOptions || {});
const newInterval = (typeof publisherSpeakingEventsOptions.interval === 'number') ?
publisherSpeakingEventsOptions.interval : ((typeof currentHarkOptions.interval === 'number') ? currentHarkOptions.interval : 100);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export interface OpenViduAdvancedConfiguration {
*
* This sets the global default configuration that will affect all streams, but you can later customize these values for each specific stream by calling [[StreamManager.updatePublisherSpeakingEventsOptions]]
*/
publisherSpeakingEventsOptions?: any;
publisherSpeakingEventsOptions?: {
interval?: number;
threshold?: number;
};

/**
* Determines the automatic reconnection process policy. Whenever the client's network drops, OpenVidu Browser starts a reconnection process with OpenVidu Server. After network is recovered, OpenVidu Browser automatically
Expand Down

0 comments on commit d320da6

Please sign in to comment.