Giter Club home page Giter Club logo

Comments (5)

Sean-Der avatar Sean-Der commented on May 22, 2024 1

Hey @daonb mind trying at the global level also?

pion/webrtc does that here

It might be nice to add AttributeRecursive? This would be useful for ice as well!

from sdp.

jerry-tao avatar jerry-tao commented on May 22, 2024

fp,ok:=s.MediaDescriptions[0].Attribute("fingerprint")

from sdp.

daonb avatar daonb commented on May 22, 2024

fp,ok:=s.MediaDescriptions[0].Attribute("fingerprint")

Thanks!

I've tried using it instead of the regex I have now but I keep getting a !ok. Here's my code

func GetFingerprint(sd *webrtc.SessionDescription) (string, error) {
    s, err := sd.Unmarshal()
    if err != nil {
       return "", fmt.Errorf("Failed to unmarshal sdp: %w", err)
    }

    fp, ok := s.MediaDescriptions[0].Attribute("fingerprint")
    if !ok {
         return "", fmt.Errorf("Failed to get fingerprint from sdp")
    }
    ...

from sdp.

daonb avatar daonb commented on May 22, 2024

Hey @daonb mind trying at the global level also?
pion/webrtc does that here

It works! Thanks. I've ended up using the global level Attribute as terminal7 has no media.

It might be nice to add AttributeRecursive? This would be useful for ice as well!

I'd be happy to help, but I think we should find a better name as it's not really recursive. How about CollectAttribute?

from sdp.

Sean-Der avatar Sean-Der commented on May 22, 2024

Closing as 'Not Planned'.

This would be a useful helper, but I think it has some ambiguity that will make it harder to land

  • What is the behavior if the attributes differ?
  • Should we notify the user if was found at global or media level?
  • ?

If someone is passionate about this issue I am here to help though!

from sdp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.