question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Overriding media acquisition is too hard

See original GitHub issue

Is your feature request related to a problem? Please describe. Maintainers of SIP.js have made clear in several instances (#588, #602, #696) that using a custom MediaStream as a source instead of getUserMedia() should be done through the implementation of a custom SessionDescriptionHandler. I’m fine with that.

In 0.14 however, the library has been rewritten in typescript, and most of the methods of Web.SessionDescriptionHandler are now private. This means that, to implement the rather small change from #588, one is required to reimplement the whole getDescription() method, while previously overwriting acquire() was enough.

Duplicating everything adds to the maintenance burden, as it forces to track every change to the upstream class. Bugs can easily slip through. It also means duplicating the whole class including modifier handling, ICE, etc., which are already solved problems.

Describe the solution you’d like Because of that, would it be possible to devise a way to only override the acquisition part of Web.SessionDescriptionHandler (ideally, only the actual stream creation part)?

I can imagine two ways this could be implemented, depending on what fits the library style best, while not adding much maintenance burden to SIP.js itself:

  • through inheritance, using a protected getMediaStreams(constraints: any): Promise<MediaStream[]> method,
  • through inheritance, by splitting getDescription() into individually overridable parts,
  • though some sort of callback in the SessionDescriptionHandlerOptions interface or in events.

Also, due to the way the library uses different options in different contexts (in this case, UA sessionDescriptionHandlerFactoryOptions at creation time but constructor options at INVITE time) it might be useful to pass the options along to whatever solution is chosen.

Describe alternatives you’ve considered I tried implementing a modifier that would add mediastream tracks and call createOffer() again, but this fails due to Firefox complaining that you cannot call createOffer() twice.

I could not find any other hook or overridable methods that could make this feature available easily.

Additional context I need to create a session without requesting user device access.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
james-criscuolocommented, Jul 6, 2020

Closing this as the proposal was released in 0.17.0.

1reaction
egreenmachinecommented, Jul 9, 2019

I pushed 7caeb88f4071902ad4a5c357d5f286bc602921a2 as a first pass at this. Let me know if it covers what you were looking for. We plan to do a bit more work here after the next release is settled.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage media rules and overrides - Google Web Designer Help
Media rules let you override the default styles and other attributes for different viewport sizes. A media rule applies to either a specific...
Read more >
Guidelines for Media Sanitization
An often rich source of illicit information collection is either through dumpster diving for improperly disposed hard copy media, acquisition of improperly ...
Read more >
Cultivation Theory - an overview | ScienceDirect Topics
Cultivation researchers argue that media effects are massive, long term, and cumulative, influencing a large and heterogeneous public by exposing the public ...
Read more >
Rising Phoenix Royalties Announces Another SCOOP ...
DALLAS, May 5, 2022 /PRNewswire/ -- Rising Phoenix Royalties (RPR) reveals the purchase of an overriding royalty interest from an undisclosed ...
Read more >
Data erasure - Wikipedia
Data erasure is a software-based method of overwriting the data that aims to completely destroy all electronic data residing on a hard disk...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found