EricssonResearch / openwebrtc

A cross-platform WebRTC client framework based on GStreamer
http://www.openwebrtc.org
BSD 2-Clause "Simplified" License
1.8k stars 537 forks source link

android to firefox/chrome video calling demo #622

Open chetanbnaik opened 8 years ago

chetanbnaik commented 8 years ago

Hi,

I am trying to run this simple demo from https://github.com/EricssonResearch/openwebrtc-examples/tree/master/web. one end is an android client and the other end is a firefox client.

when I make a call from android to firefox, I get the following error on firefox console: image

Its the "d is not defined" I am worried about.

and similarly when I call from firefox to android, I get the following error on android device:

`

07-21 03:08:11.921 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: invalid event: data:  "sessionDescription": { => [data,   "sessionDescription": {]
07-21 03:08:11.921 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:    "version": 0,
07-21 03:08:11.921 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:    "originator": {
07-21 03:08:11.921 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:      "username": "mozilla...THIS_IS_SDPARTA-47.0",
07-21 03:08:11.925 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:      "sessionId": "1259124856880794212",
07-21 03:08:11.925 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:      "sessionVersion": 0,
07-21 03:08:11.925 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:      "netType": "IN",
07-21 03:08:11.925 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:      "addressType": "IP4",
07-21 03:08:11.925 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:      "address": "0.0.0.0"
07-21 03:08:11.933 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:    },
07-21 03:08:11.933 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:    "sessionName": "-",
07-21 03:08:11.949 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:    "startTime": 0,
07-21 03:08:11.952 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:    "stopTime": 0,
07-21 03:08:11.952 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:    "mediaDescriptions": [
07-21 03:08:11.952 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:      {
07-21 03:08:11.952 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:        "type": "video",
07-21 03:08:11.952 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:        "port": 9,
07-21 03:08:11.956 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:        "protocol": "UDP/TLS/RTP/SAVPF",
07-21 03:08:11.956 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:        "netType": "IN",
07-21 03:08:11.956 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:        "addressType": "IP4",
07-21 03:08:11.956 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:        "address": "0.0.0.0",
07-21 03:08:11.956 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:        "mode": "sendrecv",
07-21 03:08:11.956 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:        "payloads": [
07-21 03:08:11.956 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:          {
07-21 03:08:11.960 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "type": 120,
07-21 03:08:11.960 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "encodingName": "VP8",
07-21 03:08:11.960 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "clockRate": 90000,
07-21 03:08:11.960 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "nack": true,
07-21 03:08:11.964 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "nackpli": true,
07-21 03:08:11.964 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "ccmfir": true,
07-21 03:08:11.964 1363-1363/com.ericsson.research.owr.examples.nativecall W/EventSource: failed to decode message: org.json.JSONException: End of input at character 1 of {
07-21 03:08:11.968 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "ericscream": false,
07-21 03:08:11.968 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "parameters": {
07-21 03:08:11.968 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:              "maxFs": 12288,
07-21 03:08:11.968 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:              "maxFr": 60
07-21 03:08:11.968 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            }
07-21 03:08:11.968 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:          },
07-21 03:08:11.968 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:          {
07-21 03:08:11.968 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "type": 126,
07-21 03:08:11.968 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "encodingName": "H264",
07-21 03:08:11.972 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "clockRate": 90000,
07-21 03:08:11.972 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "nack": true,
07-21 03:08:11.972 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "nackpli": true,
07-21 03:08:11.972 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "ccmfir": true,
07-21 03:08:11.972 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "ericscream": false,
07-21 03:08:11.972 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "parameters": {
07-21 03:08:11.976 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:              "profileLevelId": "42e028",
07-21 03:08:11.976 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:              "levelAsymmetryAllowed": 1,
07-21 03:08:11.976 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:              "packetizationMode": 1
07-21 03:08:11.976 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            }
07-21 03:08:11.976 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:          },
07-21 03:08:11.976 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:          {
07-21 03:08:11.976 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "type": 97,
07-21 03:08:11.976 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "encodingName": "H264",
07-21 03:08:11.980 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "clockRate": 90000,
07-21 03:08:11.980 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "nack": true,
07-21 03:08:11.980 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "nackpli": true,
07-21 03:08:11.980 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "ccmfir": true,
07-21 03:08:11.980 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "ericscream": false,
07-21 03:08:11.980 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "parameters": {
07-21 03:08:11.984 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:              "profileLevelId": "42e028",
07-21 03:08:11.984 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:              "levelAsymmetryAllowed": 1
07-21 03:08:11.984 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            }
07-21 03:08:11.984 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:          }
07-21 03:08:11.984 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:        ],
07-21 03:08:11.984 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:        "rtcp": {
07-21 03:08:11.984 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:          "mux": true
07-21 03:08:11.988 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:        },
07-21 03:08:11.988 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:        "ssrcs": [
07-21 03:08:11.988 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:          1682373397
07-21 03:08:11.988 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:        ],
07-21 03:08:11.988 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:        "cname": "{8c2bc2d0-53f2-4376-b020-f89572edc82a}",
07-21 03:08:11.988 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:        "ice": {
07-21 03:08:11.992 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:          "ufrag": "85e009ab",
07-21 03:08:11.992 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:          "password": "454c2578f0f587387306eae4c74d52c7",
07-21 03:08:11.992 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:          "iceOptions": {
07-21 03:08:11.992 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:            "trickle": true
07-21 03:08:11.992 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:          }
07-21 03:08:11.992 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:        },
07-21 03:08:11.992 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:        "dtls": {
07-21 03:08:11.995 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:          "fingerprintHashFunction": "sha-256",
07-21 03:08:11.995 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:          "fingerprint": "00:F0:25:4A:6A:77:1D:86:AB:71:32:7E:71:43:63:A4:E6:4A:47:F5:CA:2F:D7:63:07:AD:59:98:2B:08:F9:BD",
07-21 03:08:11.995 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:          "setup": "actpass"
07-21 03:08:11.995 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:        }
07-21 03:08:11.995 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:      }
07-21 03:08:11.995 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:    ]
07-21 03:08:11.995 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:  },
07-21 03:08:11.999 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:  "type": "offer"
07-21 03:08:11.999 1363-1643/com.ericsson.research.owr.examples.nativecall W/EventSource: SSE: skipped after malformed event: data:}

`

I suspect, it has something to do with the parsing of SDP. So, I modified client/sdp.js as below

                var fmtpLine = fillTemplate(regexps.fmtp, payload);
                var fmtp = match(mblock, fmtpLine, "m");
                if (fmtp) {
                    payload.parameters = {};
                    fmtp[1].replace(new RegExp(regexps.param, "g"),
                        function(_, key, value) {
                            key = key.replace(/-([a-z])/g, function (_, c) {
                                return c.toUpperCase();
                            });
                            if (key === "profileLevelId") {
                               payload.parameters[key] = value;
                            } else {
                               payload.parameters[key] = isNaN(+value) ? value : +value;
                            }
                            //payload.parameters[key] = value;
                    });
                }

Any suggestions? Do we need a better parser for SDP?