Closed Bug 1493027 Opened 6 years ago Closed 6 years ago

Access permissions without creating MediaManager

Categories

(Core :: Audio/Video: Playback, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

Details

Attachments

(2 files)

One possible scenario is that you're sharing screen with other people and also receive other people's live video stream. In this case, we should allow the autoplay.
Rank: 15
Priority: -- → P2
I found that MediaManager::IsActivelyCapturingOrHasAPermission() would return true when user grants 'screen' permission, so we have handled this case. However, we didn't handle the edge-case which was mentioned in bug1182329 comment49, and also didn't have any test cases yet. So I will fix that edge-case and add test case in this bug.
Summary: Allow autoplay for the site which grant the 'sharing-screen' permission → Access permissions before creating MediaManager
Summary: Access permissions before creating MediaManager → Access permissions without creating MediaManager
If a site had been granted persistent permissions, but hasn't accessed navigator.mediaDevices yet. Then, we can't read the permission because MediaManager hasn't be created yet. We should read these permissions without loading MediaManager. In addition, I noticed that even user only requests 'screen' permission, we would also add the 'camera' and 'microphone' permission in the nsIPermissionManager. That makes us no way to print the log to distinguish what actually permission user granted.
Comment on attachment 9011128 [details] Bug 1493027 - part1 : access permissions without creating MediaManager. Chris Pearce (:cpearce) has approved the revision.
Attachment #9011128 - Flags: review+
Comment on attachment 9011129 [details] Bug 1493027 - part2 : add test. Chris Pearce (:cpearce) has approved the revision.
Attachment #9011129 - Flags: review+
Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fd4c5546dfa3 part1 : access permissions without creating MediaManager. r=cpearce
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: