feat(IFrameApi): setAudioOnly command & event.

This commit is contained in:
Hristo Terezov
2024-11-14 16:48:45 -06:00
parent 6af4d182d0
commit 037a7c082c
3 changed files with 30 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ import {
requestEnableVideoModeration
} from '../../react/features/av-moderation/actions';
import { isEnabledFromState } from '../../react/features/av-moderation/functions';
import { setAudioOnly } from '../../react/features/base/audio-only/actions';
import {
endConference,
sendTones,
@@ -565,6 +566,10 @@ function initCommands() {
sendAnalytics(createApiEvent('set.video.quality'));
APP.store.dispatch(setVideoQuality(frameHeight));
},
'set-audio-only': enable => {
sendAnalytics(createApiEvent('set.audio.only'));
APP.store.dispatch(setAudioOnly(enable));
},
'start-share-video': url => {
sendAnalytics(createApiEvent('share.video.start'));
const id = extractYoutubeIdOrURL(url);
@@ -2218,6 +2223,19 @@ class API {
});
}
/**
* Notify the external application (if API is enabled) when the audio only enabled status changed.
*
* @param {boolean} enabled - Whether the audio only is enabled or not.
* @returns {void}
*/
notifyAudioOnlyChanged(enabled) {
this._sendEvent({
name: 'audio-only-changed',
enabled
});
}
/**
* Disposes the allocated resources.
*