Skip to content

Experiencing Data Channel MediaHandler error after upgrading to 0.7.0 #175

Closed

Description

@hattmarris

Wondering if you guys had encountered this error in the MediaHandler function for file / data transfer?

We're using the mediaHandlerFactory in the DataUA configuration object from the full app demo http://sipjs.com/guides/full-demo-app/

when loading 0.7.0, we're seeing -
Uncaught TypeError: onSuccess.bind is not a function

screenshot from 2015-05-20 13 27 14

screenshot from 2015-05-20 13 28 01

Activity

  1. josephfrazier commented on May 20, 2015

    @josephfrazier
    Contributor

    Thanks for pointing this out. It was a subtle change that slipped my mind. I'll have to update the demo and documentation, but here's the gist of things:

    Version 0.7.0 changes the MediaHandler and MediaStreamManager interfaces to use Promises instead of callbacks. It tries to be backward-compatible by patching callback-oriented custom implementations of MediaStreamManager (e3f7af6), but the particular implementation in the demo does not get patched since it defines acquire as having only one argument.

    Here's an updated demo using version 0.7.0 with a Promise-oriented MediaHandler and MediaStreamManager. The section of code in question needed to be changed to:

                /* Like a default mediaHandler, but no streams to manage */
                var self = new SIP.WebRTC.MediaHandler(session, {
                    mediaStreamManager: {
                        acquire: function (mediaHint) {
                            return SIP.Utils.Promise.resolve([]);
                        },
                        release: function (stream) {
                            // no-op
                        }
                    }
                });
    
                return self;

    Also note that self.addStream is no longer overridden. It was changed to addStreams, which behaves correctly when there are no streams in the array returned by MediaStreamManager#acquire.

  2. hattmarris commented on May 21, 2015

    @hattmarris
    Author

    No problem, and thank you Joseph - I will give 0.7.0 another spin today. much appreciated - !

    Matt

  3. josephfrazier commented on May 22, 2015

    @josephfrazier
    Contributor

    Sure thing, let us know if run into any more bugs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions