Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an API to know if createEncoded{Audio,Video}Streams was called #13

Closed
saghul opened this issue Apr 16, 2020 · 6 comments
Closed

Add an API to know if createEncoded{Audio,Video}Streams was called #13

saghul opened this issue Apr 16, 2020 · 6 comments

Comments

@saghul
Copy link

saghul commented Apr 16, 2020

Hey there!

While integraating this on Jitsi Meet we ran into the case of calling createEncodedVideoStreams more than once by mistake. This currently throws an exception, which is nice, but there is no way to know in advance if we already created the encoded audio / video stream.

We solved it by using a custom hidden (with a Symbol) attritute on the sender / receiver, but it would be nice to be able to have an "official" API for this.

@alvestrand
Copy link
Contributor

alvestrand commented May 6, 2020

I kind of think that throwing an exception is a fine way of querying the interface.... I don't quite get the use case for querying whether or not cretaeEncoded*Streams has been called when you don't intend to call it at once.
You can't get any frames flowing before you call createEncoded*Streams (that's why there has to be a boolean in the RTCPeerConnection argument), so nothing real will happen until you call it.

@saghul
Copy link
Author

saghul commented May 6, 2020

On complex codebases (we ran into this on Jitsi Meet) there many placess where that might need to be called. Keeping track of it is not very simple on such large codebases, hence our desire for an API which would allow us to remove the "workaround".

@alvestrand
Copy link
Contributor

Complex codebases are complex. Phrasing the question differently ... are there places where you need to query this property where you do not want to initialize at once? And why not?

@saghul
Copy link
Author

saghul commented May 6, 2020

No, I don't think we have that use-case as of yet. We want to check and enable it if it's not already enabled.

I guess it boils down to a "look before you leap" vs "ask for forgiveness than permisssion" approach to the API.

@alvestrand
Copy link
Contributor

if this had been python, the clear advice would be to try & ask forgiveness; in C++ it's the other way around. In Javascript, I feel like it's 2/3 try & ask, and 1/3 look-before-leap, so I'm unsure.

@alvestrand
Copy link
Contributor

Since the updated API doesn't have createEncodedStreams() any more, I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants