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

Scalable Video Coding example needs update #1594

Closed opusonline closed 1 year ago

opusonline commented 1 year ago

Please read first!

Please use discuss-webrtc for general technical discussions and questions. If you have found an issue/bug with the native libwebrtc SDK or a browser's behaviour around WebRTC please create an issue in the relevant bug tracker. You can find more information on how to submit a bug and do so in the right place here

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 (e.g. Chrome 64.0.3282.119) no specific version, but I have tested it with Chrome 111.0.5563.64

Description

Thank you for having the Scalable Video Codec sample, but unfortunately it relies on using an outdated and non-working feature, so the sample can't be used.

https://github.com/webrtc/samples/blob/gh-pages/src/content/extensions/svc/js/main.js#L108

The sample uses the SVC extension of .getCapabilities(), but this has been removed. It should be replaced with the current working method navigator.mediaCapabilities.encodingInfo with video scalabilityMode parameter.

Here's the discussion about "getCapabilities() vs. MediaCapabilities":

Steps to reproduce

Open https://webrtc.github.io/samples/src/content/extensions/svc/ in any browser that supports SVC (currently Chrome since v111, see https://chromestatus.com/feature/5769626174619648) and select any codec that should support scalability modes, like VP9 or AV1.

Expected results

The "Scalability Mode" dropdown should act accordingly and contain supported scalability modes for each selected codec.

Actual results

The "Scalability Mode" dropdown will always stay disabled and only contain the option "NONE".

alvestrand commented 1 year ago

Florent, can you take on the task to update this?

alvestrand commented 1 year ago

the fix shoujld be a fine example of how to use MediaCapabilities to work around the lack of an enumeration feature.

Orphis commented 1 year ago

Fixed by #1595.