Closed Bug 1554778 Opened 3 months ago Closed 3 months ago

GeckoSession.MediaDelegate.onRecordingStatusChanged() not called when navigating away

Categories

(GeckoView :: General, defect, P1)

Unspecified
Android
defect

Tracking

(firefox67 wontfix, firefox67.0.1 wontfix, firefox68 fixed, firefox69 fixed)

RESOLVED FIXED
mozilla69
Tracking Status
firefox67 --- wontfix
firefox67.0.1 --- wontfix
firefox68 --- fixed
firefox69 --- fixed

People

(Reporter: sebastian, Assigned: fluffyemily)

References

Details

(Whiteboard: [geckoview:fenix:m6])

Attachments

(1 file)

STR:

  • Go to a website that uses the camera (e.g. https://webrtc.github.io/samples/)
  • Observe onRecordingStatusChanged() getting called with a CAMERA device
  • Navigate to another page

Expected:

  • onRecordingStatusChanged() getting called again with an empty device list

Actual:

  • onRecordingStatusChanged() not getting called.

Alternatively I could listen to a different event to clear the recording status - but which one? As a workaround I cleared the state from GeckoSession.NavigationDelegate.onLocationChange - but I assume a location change does not mean that no device is recording anymore?

Comparing with GeckoSession.MediaDelegate.onMediaAdd() / onMediaRemove(): I see onMediaRemove() getting called when leaving the page that contains media.

Summary: GeckoSession.MediaDelegate.onRecordingStatusChanged() not called when navigation away → GeckoSession.MediaDelegate.onRecordingStatusChanged() not called when navigating away
OS: All → Android
Priority: -- → P1
Whiteboard: [geckoview:fenix:m6]

This is caused because, when navigating away from a page while video is recording, the dispatcher is no longer present at the point we are fetching it causing the attempt to send the GeckoView:MediaRecordingStatusChanged from JS to Java to fail. This fix is to fetch the dispatcher earlier in the function to ensure it remains present when the message is sent.

This is because in some circumstances, when navigating away from a page, the dispatcher is no longer present when trying to send the GeckoView:MediaRecordingStatusChanged causing the message not to be sent. Fetching the dispatcher earlier ensures that it is present at the point of message sending.

Pushed by etoop@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/71fc0f7a8846
Fetch dispatcher at the beginning of `handleRecordingDeviceEvents`. r=geckoview-reviewers,snorp

Retroactively assigning to Emily since she fixed this bug. We should uplift to GV 68 Beta for Fenix MVP.

Assignee: nobody → etoop
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69

Per bug 1549633 please request uplift here too.

Flags: needinfo?(etoop)

Comment on attachment 9068029 [details]
Bug 1554778 - Fetch dispatcher at the beginning of handleRecordingDeviceEvents.

Beta/Release Uplift Approval Request

  • User impact if declined: Important bugfix recording device status API for Fenix. Without this there are cases where the API methods are not called.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: Bug 1549633
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky):
  • String changes made/needed:
Flags: needinfo?(etoop)
Attachment #9068029 - Flags: approval-mozilla-beta?

Comment on attachment 9068029 [details]
Bug 1554778 - Fetch dispatcher at the beginning of handleRecordingDeviceEvents.

approved for beta68

Attachment #9068029 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.