Zamok Kiosk API
    Preparing search index...
    • Converts a boolean active state into the corresponding claim or release action.

      Parameters

      • isActive: boolean
      • claim: AudioFocusClaimInput

      Returns
          | {
              payload: {
                  claimedAt: number;
                  label: string;
                  moduleName: string;
                  ownerId: string;
                  priorityGroup: AudioFocusPriorityGroup;
                  reason?: string;
                  resources: AudioResource[];
              };
              type: "AUDIO_FOCUS/CLAIM";
          }
          | PayloadAction<"AUDIO_FOCUS/RELEASE", { ownerId: string }>

      Use this helper inside epics that observe whether a feature is currently using audio. When isActive is true, it returns claimAudioFocus; when false, it returns releaseAudioFocus for the same ownerId. The claim argument must therefore contain the full metadata needed for claiming even though only ownerId is used on release.

      createAudioFocusAction(isInCall, {
      ownerId: 'video-zoom:call',
      moduleName: 'module-video-zoom',
      label: 'Zoom call',
      resources: ['microphone', 'speaker'],
      priorityGroup: 'call',
      reason: 'Zoom call active',
      });