# Auto start Audio on join session

**URL:** <https://devforum.zoom.us/t/auto-start-audio-on-join-session/90294>\
**Category:** Web\
**Tags:** video-sdk\
**Created:** [June 16, 2023, 8:10am UTC](https://devforum.zoom.us/t/auto-start-audio-on-join-session/90294 "2023-06-16T08:10:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arfa.ahmed](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/arfa.ahmed/32/33501_2.png) [@arfa.ahmed](https://devforum.zoom.us/u/arfa.ahmed)\
**Post date:** [June 16, 2023, 8:10am UTC](https://devforum.zoom.us/t/auto-start-audio-on-join-session/90294/1 "2023-06-16T08:10:39Z")

</div>

**Description**  
According to the Zoom Video SDK Web documentation, it is mentioned that we should associate the startAudio function with a user button click. Here is an image showing the reference:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/c/8/c80b72974baa37fe0ff9fd0c52847152a4053d66.png)

Is there any way to automatically start the audio when a user successfully joins the session? This functionality should work on all web browsers, mobile web browsers, and WebViews. Currently, we are already requiring user interaction through a button click to join the session, so it is guaranteed that the user has interacted with the web page before joining.

**Which Web Video SDK version?**  
Web Video SDK: 1.7.7

**Video SDK Code Snippets**  
Currently, using this code which will call on mic button click:

```auto
const onMicrophoneClick = useCallback(async () => {
		if (!isStartedAudio) {
			// await mediaStream?.startAudio({ speakerOnly: true });
			await mediaStream?.startAudio();
			setIsStartedAudio(true);
		}
		if (isMuted) {
			await mediaStream?.unmuteAudio();
			setIsMuted(false);
		} else {
			await mediaStream?.muteAudio();
			setIsMuted(true);
		}
	  }, [mediaStream, isStartedAudio, isMuted, userUnmutedAfterJoin]);

```

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [June 16, 2023, 3:38pm UTC](https://devforum.zoom.us/t/auto-start-audio-on-join-session/90294/2 "2023-06-16T15:38:42Z")

</div>

Hey @arfa.ahmed

Thanks for your feedback.

> [@arfa.ahmed](#):
>
> Is there any way to automatically start the audio when a user successfully joins the session?

We cannot get it to work on Safari. As you mentioned above, `startAudio` function needs to be invoked within the click event callback. It’s a limitation on Safari.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![arfa.ahmed](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/arfa.ahmed/32/33501_2.png) [@arfa.ahmed](https://devforum.zoom.us/u/arfa.ahmed)\
**Post date:** [June 16, 2023, 6:26pm UTC](https://devforum.zoom.us/t/auto-start-audio-on-join-session/90294/3 "2023-06-16T18:26:41Z")

</div>

Thanks for your response. As mentioned earlier, in our web app, the user needs to click on a button to join the session, ensuring their interaction with the web page before joining. However, I’m seeking guidance on when and how to call the startAudio function in order to ensure compatibility across all web browsers. Unfortunately, I couldn’t find any specific method for this in your documentation or demo app. Could you please provide some recommendations or guidance on this matter?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [July 17, 2023, 4:27am UTC](https://devforum.zoom.us/t/auto-start-audio-on-join-session/90294/4 "2023-07-17T04:27:37Z")

</div>

Closed on July 17, 2023, 4:27am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
