# Sometimes mediaCapturePermission API doesn't work

**URL:** <https://devforum.zoom.us/t/sometimes-mediacapturepermission-api-doesnt-work/95658>\
**Category:** Web\
**Created:** [September 23, 2023, 10:15am UTC](https://devforum.zoom.us/t/sometimes-mediacapturepermission-api-doesnt-work/95658 "2023-09-23T10:15:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kanata.koyama](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/kanata.koyama/32/45206_2.png) [@kanata.koyama](https://devforum.zoom.us/u/kanata.koyama)\
**Post date:** [September 23, 2023, 10:15am UTC](https://devforum.zoom.us/t/sometimes-mediacapturepermission-api-doesnt-work/95658/1 "2023-09-23T10:15:02Z")

</div>

**Description**  
Sometimes, the recording request modal may not appear. I suspect sometimes that the mediaCapturePermission API may not work in my meeting bot implementation. The bot implementation triggers the `onPreviewPannel` event panel, as shown in the snippet below, but is there a more appropriate way to implement this?

**Browser Console Error**

**Which Web Meeting SDK version?**  
2.15.2

**Meeting SDK Code Snippets**

```auto
ZoomMtg.join({
  ...
  success: () => {
     afterJoin()
  }

function afterJoin() {
  ZoomMtg.inMeetingServiceListener(
    'onPreviewPannel',
    handlePreviewPannel
  );
}
function handlePreviewPannel({preJoin: boolean}) {
  if (boolean === false) {
    console.log('mediaCapturePermission request')
    ZoomMtg.mediaCapturePermission({
       operate: 'request'
       success: () => {
              console.log('mediaCapturePermission success')
       }
       error: ({errorCode, errorMessage}) => {
              console.log('mediaCapturePermission error', errorCode, errorMessage);
       },
    });
  }
}

```

**To Reproduce(If applicable)**  
Steps to reproduce the behavior:

1. turn on “Local Recording” in setting page
2. the host(human) starts a meeting
3. the bot (above snippets) joins the meeting
4. sometimes, the recording request modal doesn’t appear, and just ‘mediaCapturePermission request’ appear in console log but **neither ‘mediaCapturePermission success’ nor ‘mediaCapturePermission error’ don’t appear.**

**Screenshots**  
If applicable, add screenshots to help explain your problem.

**Troubleshooting Routes**  
The troubleshooting attempt types you’ve already exhausted, including testing with the appropriate sample app (found on [Zoom · GitHub](https://github.com/zoom)).

**Device (please complete the following information):**

- Device: GCE instance
- OS: Ubuntu 22.04
- Browser: chrome
- Browser Version: google-chrome-stable\_108.0.5359.124-1

**Additional context**

---

<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:** [October 23, 2023, 8:15pm UTC](https://devforum.zoom.us/t/sometimes-mediacapturepermission-api-doesnt-work/95658/2 "2023-10-23T20:15:35Z")

</div>

Closed on October 23, 2023, 8:15pm UTC

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