Open Bug 1966690 Opened 1 year ago Updated 10 days ago

cammatch.com - Unable to start chatting, camera and microphone error despite permission being granted

Categories

(Web Compatibility :: Site Reports, defect, P3)

Firefox 140
ARM
Android

Tracking

(Webcompat Priority:P2, Webcompat Score:4, firefox138 affected, firefox139 affected, firefox140 affected, firefox158 affected)

Webcompat Priority P2
Webcompat Score 4
Tracking Status
firefox138 --- affected
firefox139 --- affected
firefox140 --- affected
firefox158 --- affected

People

(Reporter: ctanase, Unassigned)

References

()

Details

(Keywords: webcompat:needs-sitepatch, webcompat:platform-bug, webcompat:site-report, Whiteboard: [webcompat-source:web-bugs])

User Story

platform:android
impact:site-broken
configuration:general
affects:all
branch:release
diagnosis-team:video-conferencing
user-impact-score:100

Attachments

(1 file)

Environment:
Operating system: Android 15
Firefox version: Firefox Mobile 137.0/138/140

Steps to reproduce:

  1. Go to https://www.cammatch.com
  2. Select gender.
  3. Confirm the "WELCOME" pop-up.
  4. Tap on "Start chatting".
  5. Allow permission for microphone and camera when prompted.
  6. Observe the behavior.

Expected Behavior:
Camera preview is shown and "Start searching" button is displayed.

Actual Behavior:
Error regarding camera and microphone not being allowed.

Notes:

  • Does not reproduce on Desktop
  • Reproduces regardless of the status of ETP
  • Reproduces in firefox-nightly, and firefox-release
  • Does not reproduce in chrome

Created from https://github.com/webcompat/web-bugs/issues/154311

Attached image image.png —
Version: unspecified → Firefox 140

Since nightly and release are affected, beta will likely be affected too.
For more information, please visit BugBot documentation.

Severity: -- → S2
User Story: (updated)
Webcompat Priority: --- → P3
Webcompat Score: --- → 5
Priority: -- → P3
Webcompat Score: 5 → 4

I see this kind of code:

    static async getMediaPermissions() {
      const e = await navigator.permissions.query({
        name: 'camera'
      }),
      t = await navigator.permissions.query({
        name: 'microphone'
      });
      return {
        camera: e.state,
        microphone: t.state
      }
    }
    static async requestMediaPermissions(e, t) {
      (await navigator.mediaDevices.getUserMedia({
        audio: e,
        video: t
      })).getTracks().forEach(n => {
        n.stop()
      })
    }

and

    static async requestAvailableMediaStream(e, t = !0) {
      if (!se.supportsPermissionsAPI()) return se.requestMediaStream(e);
      const n = !!e.audio,
      i = !!e.video;
      let a = await se.getMediaPermissions();
      if (t) {
        const c = a.microphone === 'prompt' &&
        n,
        l = a.camera === 'prompt' &&
        i;
        if (c || l) try {
          await se.requestMediaPermissions(c, l)
        } catch (v) {
          console.error('Failed to prompt for media permissions', v)
        }
        a = await se.getMediaPermissions()
      }
      const r = a.microphone === 'granted',
      o = a.camera === 'granted';
      return r ||
      o ? se.requestMediaStream({
        audio: r ? e.audio : !1,
        video: o ? e.video : !1
      }) : new MediaStream
    }

On Android per bug 1902460 comment 6 we only return 'prompt' for camera and microphone with temporary permissions. If t in the code above is truthy, requestAvailableMediaStream is going to return an empty MediaStream, which is likely causing the callsite to report an error.

Depends on: 1924572
See Also: → 1902460

An intervention could be suitable here just like for bug 1902460.

Webcompat Priority: P3 → P2

Could you please test if this still reproduces with the latest Nightly. The Nightly from today includes Bug 1924572 which should fix this issue.

Flags: needinfo?(ctanase)

Still reproducible on the latest Nightly.

Note: account needed now, it asks to log in

Flags: needinfo?(ctanase)
Flags: needinfo?(emz)

I don't have time to investigate this currently. If the permissions API is involved Bug 1924572 could help here, but as stated in comment 6 the issue persists.

Flags: needinfo?(emz)

Seems to reproduce with and without the intervention active.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: