Function checkPermission

  • Checks the permission based on the provided settings.

    Parameters

    Returns Promise<0 | 1 | 2>

    • Returns 0 if the setting is "allow", 1 if the setting is "approval", and 2 for other settings or invalid permission types.

    Will throw an error if an unexpected error occurs during the permission check.

    const options = {
    permissionType: 'audioSetting',
    audioSetting: 'allow',
    videoSetting: 'approval',
    screenshareSetting: 'approval',
    chatSetting: 'allow',
    };

    checkPermission(options)
    .then(result => {
    console.log('Permission result:', result);
    })
    .catch(error => {
    console.error('Error checking permission:', error);
    });