mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 03:12:29 +00:00
feat(IFrameApi): setAudioOnly command & event.
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
2
modules/API/external/external_api.js
vendored
2
modules/API/external/external_api.js
vendored
@@ -59,6 +59,7 @@ const commands = {
|
||||
sendEndpointTextMessage: 'send-endpoint-text-message',
|
||||
sendParticipantToRoom: 'send-participant-to-room',
|
||||
sendTones: 'send-tones',
|
||||
setAudioOnly: 'set-audio-only',
|
||||
setAssumedBandwidthBps: 'set-assumed-bandwidth-bps',
|
||||
setBlurredBackground: 'set-blurred-background',
|
||||
setFollowMe: 'set-follow-me',
|
||||
@@ -103,6 +104,7 @@ const events = {
|
||||
'avatar-changed': 'avatarChanged',
|
||||
'audio-availability-changed': 'audioAvailabilityChanged',
|
||||
'audio-mute-status-changed': 'audioMuteStatusChanged',
|
||||
'audio-only-changed': 'audioOnlyChanged',
|
||||
'audio-or-video-sharing-toggled': 'audioOrVideoSharingToggled',
|
||||
'breakout-rooms-updated': 'breakoutRoomsUpdated',
|
||||
'browser-support': 'browserSupport',
|
||||
|
||||
@@ -61,3 +61,13 @@ StateListenerRegistry.register(
|
||||
APP.API.notifyOnStageParticipantChanged(participantId);
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* Updates the on audio only value.
|
||||
*/
|
||||
StateListenerRegistry.register(
|
||||
/* selector */ state => state['features/base/audio-only'].enabled,
|
||||
/* listener */ enabled => {
|
||||
APP.API.notifyAudioOnlyChanged(enabled);
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user