Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

501 Unsupported Error when using requestAppAudioHandling #2488

Open
Tryptophan opened this issue Aug 29, 2024 · 7 comments
Open

501 Unsupported Error when using requestAppAudioHandling #2488

Tryptophan opened this issue Aug 29, 2024 · 7 comments

Comments

@Tryptophan
Copy link

Hi teams dev team,

I am trying to make use of the requestAppAudioHandling method in the meeting namespace, but no matter what I try when running it I get this error:

Error: [requestAppAudioHandling] Callback response - SDK error 501 API is not supported in current context
    at meeting.ts:1199:1
    at xr (communication.ts:700:1)
    at communication.ts:452:1

Here's the code I used to reproduce this in a side panel app:

if (teamsContext?.page.frameContext === teams.FrameContexts.sidePanel) {
      teams.meeting.requestAppAudioHandling(
        {
          isAppHandlingAudio: true,
          micMuteStateChangedCallback: async (micState) => {
            console.log("got mic state", micState);
            return micState;
          },
        },
        () => {}
      );
}

Is there any way I can get this to work? It would be very beneficial to sync mic and device state between teams and my app.

@sayali-MSFT
Copy link

Thanks for reporting your issue.
We will check this at our end and will get back to you.

@sayali-MSFT
Copy link

@Tryptophan - It looks like you're encountering the SDK error 501 API is not supported in current context error when trying to use the requestAppAudioHandling method in the meeting namespace. This error typically indicates that the API you're trying to use is not supported in the current context of your application.

Ensure that the API is available and supported in the context you're using. Some APIs might only be available in specific contexts or environments.
Make sure you're using the latest version of the Microsoft Teams JavaScript SDK. Sometimes, updating to the latest version can resolve issues related to API support.

Also refer this sample-https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/meetings-audio-state/nodejs

@AE-MS
Copy link
Contributor

AE-MS commented Sep 2, 2024

Hi teams dev team,

I am trying to make use of the requestAppAudioHandling method in the meeting namespace, but no matter what I try when running it I get this error:

Error: [requestAppAudioHandling] Callback response - SDK error 501 API is not supported in current context
    at meeting.ts:1199:1
    at xr (communication.ts:700:1)
    at communication.ts:452:1

Here's the code I used to reproduce this in a side panel app:

if (teamsContext?.page.frameContext === teams.FrameContexts.sidePanel) {
      teams.meeting.requestAppAudioHandling(
        {
          isAppHandlingAudio: true,
          micMuteStateChangedCallback: async (micState) => {
            console.log("got mic state", micState);
            return micState;
          },
        },
        () => {}
      );
}

Is there any way I can get this to work? It would be very beneficial to sync mic and device state between teams and my app.

Hi @Tryptophan! Based on the sample code you provided, I assume you are trying to call requestAppAudioHandling from the FrameContexts.sidePanel frame context, is that right?

What host (e.g., Teams, Outlook, etc.) are you trying this code out in and on what platform (web, iOS, etc.)?

Are you able to gather logs from your app when reproducing the problem (https://github.com/OfficeDev/microsoft-teams-library-js/wiki/TeamsJS-Logging)?

Thanks!

@Tryptophan
Copy link
Author

I am testing this in the teams web client (chrome) with the following versions:

    "@microsoft/teams-js": "^2.22.0",
    "@microsoft/teamsfx": "^2.2.0",
    "@microsoft/teamsfx-react": "^3.0.0",

This code is run in a teams tab app in the meeting side panel during a meeting.

Is this code meant to be unsupported? I will test the teams native app on Mac OS at some point and let you know my findings, please let me know if you're able to reproduce in this environment or in the native app.

@AE-MS
Copy link
Contributor

AE-MS commented Sep 3, 2024

I am testing this in the teams web client (chrome) with the following versions:

    "@microsoft/teams-js": "^2.22.0",
    "@microsoft/teamsfx": "^2.2.0",
    "@microsoft/teamsfx-react": "^3.0.0",

This code is run in a teams tab app in the meeting side panel during a meeting.

Is this code meant to be unsupported? I will test the teams native app on Mac OS at some point and let you know my findings, please let me know if you're able to reproduce in this environment or in the native app.

Thanks for the extra details! Were you able to gather client logs when reproducing the problem?

@Tryptophan
Copy link
Author

Tryptophan commented Sep 4, 2024

Enabling debug logging did not get me any information outside of the error that is sent (same message). I tried on the native client on Mac OS and got a different error though:

SDK error 1000 App doesn’t have sufficient permission to use this API

Is there a set of permissions required to be added to the manifest for this API? I dont see it documented anywhere.

@AE-MS
Copy link
Contributor

AE-MS commented Sep 4, 2024

Thanks for providing the extra information on the scenario in Mac OS. Are you able to share the client logs? That will help me understand whether the right messages are making it from teamsjs to the host or whether the error is coming from the teamsjs side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants