mediasfu-reactnative-expo
Version:
mediasfu-reactnative-expo – Expo-managed React Native WebRTC SDK for video conferencing, webinars, live streaming, broadcast, screen sharing, whiteboard, chat, recording, live subtitles, translation, and AI agent rooms on iOS, Android, and web. Prebuilt r
42 lines • 2.08 kB
JavaScript
import { compareScreenStates as sharedCompareScreenStates } from 'mediasfu-shared';
/**
* Compares the current screen states with the previous screen states and triggers actions based on changes.
*
* @param {CompareScreenStatesOptions} options - The options for comparing screen states.
* @param {boolean} [options.restart=false] - Whether to restart the comparison process.
* @param {CompareScreenStatesParameters} options.parameters - The parameters for the comparison.
* @param {Function} options.parameters.getUpdatedAllParams - Function to get updated parameters.
* @param {string} options.parameters.recordingDisplayType - The type of display being recorded.
* @param {boolean} options.parameters.recordingVideoOptimized - Whether the recording is optimized for video.
* @param {Array<ScreenState>} options.parameters.screenStates - The current screen states.
* @param {Array<ScreenState>} options.parameters.prevScreenStates - The previous screen states.
* @param {Array<string>} options.parameters.activeNames - The active names in the current context.
* @param {Function} options.parameters.trigger - Function to trigger actions based on changes.
*
* @returns {Promise<void>} A promise that resolves when the comparison and any triggered actions are complete.
*
* @throws Will log an error message if an error occurs during the comparison process.
*
* @example
* const options = {
* restart: false,
* parameters: {
* getUpdatedAllParams: getUpdatedAllParamsFunction,
* recordingDisplayType: 'video',
* recordingVideoOptimized: true,
* screenStates: [{ key1: 'value1' }, { key2: 'value2' }],
* prevScreenStates: [{ key1: 'value1' }, { key2: 'value2' }],
* activeNames: ['name1', 'name2'],
* trigger: triggerFunction,
* },
* };
*
* compareScreenStates(options)
* .then(() => {
* console.log('Screen states compared successfully');
* });
*/
export const compareScreenStates = async (options) => {
await sharedCompareScreenStates(options);
};
//# sourceMappingURL=compareScreenStates.js.map