Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webrtc test run successfully as dart, but throw exception when run as java script in dartium. Problem RtcPeerConnection.createOffer #13258

Closed
DartBot opened this issue Sep 11, 2013 · 9 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant library-html

Comments

@DartBot
Copy link

DartBot commented Sep 11, 2013

This issue was originally filed by igor.ko...@mailvision.com


What steps will reproduce the problem?
1.have web camera in computer.
2.unzip and run included dart project.

What version of the product are you using? On what operating system?

Dart Editor version 0.7.2_r27268
Dart SDK version 0.7.2.1_r27268

Windows 7 32 bits.

------------------- run as dart (successfull) ------------------------

Invalid CSS property name: -webkit-touch-callout
makeCall
start media
makeCall2
Creating peer connection
Adding local stream to peer
create offer...
peerConn is Instance of 'RtcPeerConnection'
local sdp generated
makeCall3: offer created, ice candidates collecting...
Found ICE candidate: a=candidate:3945698694 1 udp 2113937151 192.168.0.203 51673 typ host generation 0

Found ICE candidate: a=candidate:3945698694 2 udp 2113937151 192.168.0.203 51673 typ host generation 0

Found ICE candidate: a=candidate:3945698694 1 udp 2113937151 192.168.0.203 51673 typ host generation 0

Found ICE candidate: a=candidate:3945698694 2 udp 2113937151 192.168.0.203 51673 typ host generation 0

Found ICE candidate: a=candidate:2779605366 1 tcp 1509957375 192.168.0.203 0 typ host generation 0

Found ICE candidate: a=candidate:2779605366 2 tcp 1509957375 192.168.0.203 0 typ host generation 0

Found ICE candidate: a=candidate:2779605366 1 tcp 1509957375 192.168.0.203 0 typ host generation 0

Found ICE candidate: a=candidate:2779605366 2 tcp 1509957375 192.168.0.203 0 typ host generation 0

End of ICE candidates
makeCall4
set call state as opening

----------------- run as java script in dartium (exception) --------------------------

makeCall2
Adding local stream to peer
Error: Cannot convert object to primitive value
error in callback
peerConn is Instance of 'RtcPeerConnection'
create offer...
Creating peer connection
TypeError: Cannot convert object to primitive value
    at RtcPeerConnection._createOffer_1$3 (http://127.0.0.1:3030/C:/Users/igor/dart/rtc_test/web/rtc_test.dart.js:4361:21)
    at RtcPeerConnection._createOffer$3 (http://127.0.0.1:3030/C:/Users/igor/dart/rtc_test/web/rtc_test.dart.js:4357:10)
    at RtcPeerConnection.createOffer$1 (http://127.0.0.1:3030/C:/Users/igor/dart/rtc_test/web/rtc_test.dart.js:4346:10)
    at $.createOffer$1$x (http://127.0.0.1:3030/C:/Users/igor/dart/rtc_test/web/rtc_test.dart.js:5071:39)
    at Rtc.createOffer$3 (http://127.0.0.1:3030/C:/Users/igor/dart/rtc_test/web/rtc_test.dart.js:4812:12)
    at Phone.makeCall2$1 (http://127.0.0.1:3030/C:/Users/igor/dart/rtc_test/web/rtc_test.dart.js:4750:8)
    at BoundClosure$1.$$.BoundClosure$1.call$1 (http://127.0.0.1:3030/C:/Users/igor/dart/rtc_test/web/rtc_test.dart.js:20:36)
    at Rtc_startMedia_closure.call$1 (http://127.0.0.1:3030/C:/Users/igor/dart/rtc_test/web/rtc_test.dart.js:4828:23)
    at _ThenFuture._onValue$1 (http://127.0.0.1:3030/C:/Users/igor/dart/rtc_test/web/rtc_test.dart.js:2844:26)
    at _ThenFuture._zonedSendValue$1 (http://127.0.0.1:3030/C:/Users/igor/dart/rtc_test/web/rtc_test.dart.js:2850:21)
Uncaught Error: CreateOffer failed.


So seems the problem is format of media constraints (here receiveAudio and receiveVideo is bool)

    var mediaConstraints = {
      "mandatory" : {
        "OfferToReceiveAudio" : receiveAudio,
        "OfferToReceiveVideo" : receiveVideo
      }
    };
    
    peerConn.createOffer(mediaConstraints); // <-- throw exception


Attachment:
rtc_test.zip (65.80 KB)

@dgrove
Copy link
Contributor

dgrove commented Sep 17, 2013

cc @efortuna.
Added Area-HTML, Triaged labels.

@efortuna
Copy link
Contributor

Added this to the Later milestone.

@kevmoo
Copy link
Member

kevmoo commented Apr 7, 2014

Removed Area-HTML label.
Added Area-Library, Library-Html labels.

@efortuna
Copy link
Contributor

@igor, it's not a matter of the difficulty of the bug; experimental
features are just much lower on the priority list compared to fixing more
stable parts, given the frequency that WebRTC (and other experimental
features) changes and re-breaks our work.

@efortuna
Copy link
Contributor

I'll also add that Dart is open source -- patches are welcome!

@DartBot
Copy link
Author

DartBot commented May 28, 2014

This comment was originally written by igor.ko...@mailvision.com


Hi !
Thanks for response.

Problem that my managers wish exactly the experimental feature.
(they don't know how to sold standard features ;-)

I found that using dart:js allow direct call to JS API,
so many dart library problems can be bypassed.

But until now I did not think about fix dart:html, likes:

_blink.Native_RTCPeerConnection_createOffer_Callback(this, successCallback, failureCallback, mediaConstraints);

Can I fix such thing ? Without recompile browser ?

P.S. The problem dart:js solution:

 Future createOffer({bool audio : true, bool video: true }){
    Completer completer = new Completer();
    void offerSuccess(JsObject sessionDesc){
      localSessionDesc = sessionDesc;
      completer.complete();
    }

    void offerError(e){
      localSessionDesc = null;
      completer.completeError(e);
    }

    JsObject constraints = new JsObject.jsify({
      "mandatory": {
        "OfferToReceiveAudio": audio,
        "OfferToReceiveVideo": video
      }
    });
    peerConn.callMethod("createOffer", [offerSuccess, offerError, constraints]);
    return completer.future;
  }

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@alan-knight
Copy link
Contributor

This seems to work now in Dartium, Chrome, and Firefox.


Added AssumedStale label.

@DartBot DartBot added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-html closed-obsolete Closed as the reported issue is no longer relevant labels Jan 23, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant library-html
Projects
None yet
Development

No branches or pull requests

6 participants