webrtc / samples

WebRTC Web demos and samples
https://webrtc.github.io/samples
BSD 3-Clause "New" or "Revised" License
13.94k stars 5.71k forks source link

Update insertable streams section to WebRTC Encoded transforms #1620

Open hamishwillee opened 1 year ago

hamishwillee commented 1 year ago

Note: If the checkboxes above are not checked (which you do after the issue is posted), the issue will be closed.

Browser affected

Browser name including version: Firefox 119.0a1. Also Chrome, Safari.

Description

Insertable streams samples represent a deprecated API, replaced by https://w3c.github.io/webrtc-encoded-transform/. Those are implemented from FF117

The desired result is that is it is easy to try out these examples and that they reflect the current standards.

alvestrand commented 1 year ago

Unfortunately these API changes don't have consensus; in particular, the Chromium team has not agreed that spinning up a worker should be a requirement for using encoded transforms. In particular see https://github.com/w3c/webrtc-encoded-transform/issues/105 and https://github.com/w3c/webrtc-encoded-transform/issues/89.

This has led to a situation where the Firefox and Chrome implementations have not converged on a common API.

When these samples were written, "localhost:" was treated as a trusted context by Chrome. Has that changed?

Please file a separate bug on either the API difference or the need for HTTPS, and let this bug be just about the other - these are two different concerns.

hamishwillee commented 1 year ago

@alvestrand Thank you very much - why can't we all just get along :-). This is now the bug just related to the API usage.

It would perhaps be easy enough to duplicate the "insertable" tree and rewrite the same examples with an encoded transform.

alvestrand commented 1 year ago

I believe @youennf has done it for the "encryption" sample - turned out to be relatively easy in that case. Will be more complex here because the "video analyzer" depends on the display (= main thread) being continuously updated on a per-frame basis - but shouldn't be insurmountable.

fippo commented 1 year ago

See #1468 for supporting both versions, notably the e2ee one works (after the small fixes in #1612)