Closed Bug 1179084 Opened 9 years ago Closed 2 months ago

Implement MediaStreamTrack::getCapabilities() and MediaTrackCapabilities

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
132 Branch
Webcompat Priority P2
Tracking Status
relnote-firefox --- 132+
firefox132 --- fixed

People

(Reporter: mathieu.hofman.dev+mozilla, Assigned: dbaker)

References

(Blocks 3 open bugs)

Details

(4 keywords)

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36 Steps to reproduce: Call MediaStreamTrack::getCapabilities() Actual results: Method doesn't exist Expected results: Method returns a MediaTrackCapabilities object.
Flags: needinfo?(jib)
Assignee: nobody → jib
Flags: needinfo?(jib)
Status: UNCONFIRMED → NEW
backlog: --- → webrtc/webaudio+
Rank: 25
Component: Audio/Video → WebRTC: Audio/Video
Ever confirmed: true
Priority: -- → P2
Mass change P2->P3 to align with new Mozilla triage process.
Priority: P2 → P3
Blocks: 1437002

Any chance this feature will come in near future?

See Also: → 1573356
Type: defect → enhancement

Reminder to check the privacy.resistFingerprinting pref as well as bug 1528042 when implementing this feature.

See Also: → 1528042

Any chance this feature will come in near future?

It's been 2 years. Any news?

This is currently breaking Facebook Messenger Calls, see the linked WebCompat bug. I've already reached out to them to see if they can fix it, but I'm setting a webcompat-priority here for now so that this is on our radar.

Webcompat Priority: --- → P1

... aaaand they fixed it. :)

Webcompat Priority: P1 → ---
Severity: normal → S3
Webcompat Priority: --- → ?
Webcompat Priority: ? → P2
Blocks: 1886719

Not sure how QA can test this. Should I run MediaStreamTrack::getCapabilities() in the Console of the browser, exact string? Or is there another place to run this?

Flags: needinfo?(mathieu.hofman.dev+mozilla)

Redirect a needinfo that is pending on an inactive user to the triage owner.
:jib, since the bug has recent activity, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(mathieu.hofman.dev+mozilla) → needinfo?(jib)

This is covered by automated WPT tests so there should be no need for QA to test this. Except maybe to verify facingMode is present on mobile devices perhaps?

That said, you can type the following into web console to test it:

(await navigator.mediaDevices.getUserMedia({video:true, audio:true})).getTracks().map(t => t.getCapabilities())
Flags: needinfo?(jib)

This was highlighted as a Web Compat risk recently, which seems fair.

Our earlier (media team) assessment of it as low priority is based on its usefulness (it's not super useful at all imho).

But looking at websites that don't test with Firefox, a different standard is needed. Some websites appear to be in the habit of using this pattern:

const amIOnMobile = !!mst.getCapabilities().facingMode;

...which is easily fixed by using this instead:

const amIOnMobile = !!mst.getSettings().facingMode;

Simply testing with Firefox should help address this, but if they're not doing so this advice doesn't help, and we should up-prioritize a fix, despite its overall low value add otherwise.

Priority: P3 → P2
Assignee: jib → nobody
Depends on: 1912855
Assignee: nobody → dbaker
Attachment #9421140 - Attachment description: WIP: Bug 1179084 - Implement getting cameras capabilities from MediaStreamTrack. → WIP: Bug 1179084 - Implement getting camera and microphone capabilities from MediaStreamTrack.
Attachment #9421140 - Attachment description: WIP: Bug 1179084 - Implement getting camera and microphone capabilities from MediaStreamTrack. → Bug 1179084 - Implement getting camera and microphone capabilities from MediaStreamTrack.
Attachment #9419014 - Attachment description: WIP: Bug 1179084 - Implement MediaTrackCapabilities. → Bug 1179084 - Implement MediaTrackCapabilities.
Attachment #9421141 - Attachment description: WIP: Bug 1179084 - Update WPT to support adding MediaStreamStrack::getCapabilities(). → Bug 1179084 - Update WPT to support adding MediaStreamStrack::getCapabilities().
Attachment #9419014 - Attachment description: Bug 1179084 - Implement MediaTrackCapabilities. → Bug 1179084 - Implement MediaTrackCapabilities. r=#webrtc-reviewers
Attachment #9421140 - Attachment description: Bug 1179084 - Implement getting camera and microphone capabilities from MediaStreamTrack. → Bug 1179084 - Implement getting camera and microphone capabilities from MediaStreamTrack. r=#webrtc-reviewers
Attachment #9421141 - Attachment description: Bug 1179084 - Update WPT to support adding MediaStreamStrack::getCapabilities(). → Bug 1179084 - Update WPT to support adding MediaStreamStrack::getCapabilities(). r=#webrtc-reviewers
Pushed by dbaker@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/40da10b9a99d Implement MediaTrackCapabilities. r=webidl,webrtc-reviewers,jib,smaug https://hg.mozilla.org/integration/autoland/rev/3b73074ef93b Implement getting camera and microphone capabilities from MediaStreamTrack. r=webrtc-reviewers,jib https://hg.mozilla.org/integration/autoland/rev/a086565fa15a Update WPT to support adding MediaStreamStrack::getCapabilities(). r=webrtc-reviewers,jib
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 132 Branch

Release Note Request (optional, but appreciated)
[Why is this notable]: WebRTC applications will now be able to query the capabilities of the live media track to gather capabilities. This does not implement bug 1213422 and is only for the live track.
[Affects Firefox for Android]: Yes
[Suggested wording]: The getCapabilities method allows applications to gather the media capabilities supported for the live MediaStreamTrack.
[Links (documentation, blog post, etc)]: https://www.w3.org/TR/mediacapture-streams/#dom-mediastreamtrack-getcapabilities

relnote-firefox: --- → ?

Added to the Fx132 relnotes.

No longer depends on: 1912855
No longer blocks: 1437002
Depends on: 1437002
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: