Giter VIP home page Giter VIP logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 29, 2024
I research this flying trouble and  make hack-patch for it. Test in 
Chrome-Chrome , Chrome-FF, FF-Chrome p2p call.

tmedia_session_jsep01.onGetUserMediaSuccess = function (o_stream, _This) {
    tsk_utils_log_info("onGetUserMediaSuccess");
    var This = (tmedia_session_jsep01.mozThis || _This);
    if (This && This.o_pc && This.o_mgr) {
        if(!This.b_sdp_lo_pending){
            tsk_utils_log_warn("onGetUserMediaSuccess but no local sdp request is pending");
            return;
        }

     if(This.my_mutex){tsk_utils_log_warn("onGetUserMediaSuccess already executed!"); return;}
     This.my_mutex=true;

        if (o_stream) {
            // HACK: patch for Firefox and others
            // https://groups.google.com/group/discuss-webrtc/browse_thread/thread/e30f0ffc267bce5f
            if (!o_stream.videoTracks || !o_stream.audioTracks) {
                var b_support_audio = !!(This.e_type.i_id & tmedia_type_e.AUDIO.i_id);
                var b_support_video = !!(This.e_type.i_id & tmedia_type_e.VIDEO.i_id);
                o_stream.audioTracks = o_stream.getAudioTracks ? o_stream.getAudioTracks() : { length: b_support_audio ? 1 : 0 };
                o_stream.videoTracks = o_stream.getVideoTracks ? o_stream.getVideoTracks() : { length: b_support_video ? 1 : 0 };
            }

            // save stream other next calls
            if (o_stream.audioTracks.length > 0 && o_stream.videoTracks.length == 0) {
                __o_jsep_stream_audio = o_stream;
            }
            else if (o_stream.audioTracks.length > 0 && o_stream.videoTracks.length > 0) {
                __o_jsep_stream_audiovideo = o_stream;
            }

            if (!This.o_local_stream) {
                This.o_mgr.callback(tmedia_session_events_e.STREAM_LOCAL_ACCEPTED, this.e_type);
            }

            // HACK: Firefox only allows to call gum one time
            if (tmedia_session_jsep01.mozThis) {
                __o_jsep_stream_audiovideo = __o_jsep_stream_audio = o_stream;
            }

            This.o_local_stream = o_stream;
            This.o_pc.addStream(o_stream);
        }
        else {
            // Probably call held
        }
        This.o_mgr.set_stream_local(o_stream);

        var b_answer = ((This.b_sdp_ro_pending || This.b_sdp_ro_offer) && (This.o_sdp_ro != null));
        if (b_answer) {
            tsk_utils_log_info("createAnswer");
            This.o_pc.createAnswer(
                tmedia_session_jsep01.mozThis ? tmedia_session_jsep01.onCreateSdpSuccess : function(o_offer){ tmedia_session_jsep01.onCreateSdpSuccess(o_offer, This); },
                tmedia_session_jsep01.mozThis ? tmedia_session_jsep01.onCreateSdpError : function(s_error){ tmedia_session_jsep01.onCreateSdpError(s_error, This); },
                This.o_media_constraints,
                false // createProvisionalAnswer
            );
        }
        else {
            tsk_utils_log_info("createOffer");
            This.o_pc.createOffer(
                tmedia_session_jsep01.mozThis ? tmedia_session_jsep01.onCreateSdpSuccess : function(o_offer){ tmedia_session_jsep01.onCreateSdpSuccess(o_offer, This); },
                tmedia_session_jsep01.mozThis ? tmedia_session_jsep01.onCreateSdpError : function(s_error){ tmedia_session_jsep01.onCreateSdpError(s_error, This); },
                This.o_media_constraints
            );
        }
    }
}

Original comment by [email protected] on 18 Feb 2015 at 1:48

from sipml5.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 29, 2024
@[email protected]

Wow, guy, that's just the solution I were looking for, and just the time it was 
about to hit the fan!
Problem with sipml5 + chrome 40-41 + asterisk 11.15-11.16.

I'd gladly buy a chicken and sacrifice it for deity of your choice.

Original comment by [email protected] on 19 Feb 2015 at 11:05

from sipml5.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 29, 2024
What do you think will be this patch-update in the next official release?

We rolled back to the stable version 1.4.217. But most likely we need the 
additional support for the FF browser. Looking forward to the FF-36 release, 35 
doesn't work for us.

In any case, thank you for support and answers in this post!

Original comment by [email protected] on 19 Feb 2015 at 11:37

from sipml5.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 29, 2024

Original comment by [email protected] on 18 Mar 2015 at 9:03

  • Changed state: Accepted

from sipml5.

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.