feat: add new removeLineByKey method as a PoC#20
Conversation
| } | ||
|
|
||
| // The 'otherLines' key would represent any other line in otherLines. | ||
| if (key === 'otherLines') { |
There was a problem hiding this comment.
I'd say this doesn't work very well for the 'other lines' case--do you have any ideas on how that situation would be supported in this scheme?
There was a problem hiding this comment.
Yeah, I think it's important to be able to handle otherLines here. If we're going to have this API, I'm wondering if the param for this function should just be a Line, similar to the addLine API? That would allow this API to work with any line (including otherLines), not just lines that are associated with a property of MediaDescription.
Calling this API then, would look something like mediaDescription.removeLine(mediaDescription.bandwidth).
This would be tricky for some of the properties though. mid and setup, for example, are not actual lines, so we'd have to handle those a bit differently.
There was a problem hiding this comment.
@bbaldino I've discussed some current code logic with @brycetham, and this example implementation will not be a good idea due to issues with "other lines" as you mentioned. But I want to take time and think about the idea mediaDescription.removeLine(mediaDescription.bandwidth). I also had such an idea, so I just need to see how tricky it is to change some properties' implementations. I will prepare a new example and update this PR. Still, I think aligning functionality to removing likes could be a good idea, and later, it can save us time and keep in our base better abstraction.
@brycetham @bbaldino thanks you for your thoughts and discussion
Hello, team. I would like to share my Proof of Concept (PoC) regarding the use of the
MediaDescriptionmethod. Currently, the method only allows adding lines to the Session Description Protocol (SDP). However, I encountered a situation where I needed to delete certain lines from the SDP. To address this, I propose a new method allowing deleting lines from the SDP. My idea is to use specific key strings to avoid any typos or errors. This method will ideally be used in TypeScript projects, but it will also be able to handle strange key values. I would appreciate your thoughts and feedback on this. Let's discuss if this can potentially be useful for our project.Here's an example of how we are currently working in WCME with deleting properties:
with this PoC:
Some additional thoughts on why it may potentially be a better option:
Using
mediaDescription.bandwidth = undefineddoes not seem the best option because we have a library that manipulates with SDP, and here, when using the previous option, we disregard the abstraction and directly manipulate the object. If, in the future, theMediaDescriptionclass is no longer an object, then we will have to find all the places that work directly with the object and update them. However, usingmediaDescription.removeLineByKey("bandwidth")will only change the implementation of ats-sdpmethod.I also noticed that we have an
AvMediaDescriptionclass with some extra properties that have been deleted in the same way. Additionally, we can a similar handling method which could also be placed inside theAvMediaDescriptionclass. This would allow for the handling of deletion keys, such asmediaDescription.simulcast = undefined, from within theAvMediaDescriptionclass.