From 00278e4e9b4bd59be61ce48e356a57e47605839f Mon Sep 17 00:00:00 2001 From: Lance Mojaver Date: Thu, 17 Mar 2016 12:14:00 -0700 Subject: [PATCH] add support for base64 strings in fmtp --- lib/parser.js | 2 +- test/normal.sdp | 2 +- test/parse.test.js | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/parser.js b/lib/parser.js index b5c75e1..10ad96a 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -64,7 +64,7 @@ exports.parse = function (sdp) { }; var fmtpReducer = function (acc, expr) { - var s = expr.split('='); + var s = expr.split(/=(.+)/, 2); if (s.length === 2) { acc[s[0]] = toIntIfInt(s[1]); } diff --git a/test/normal.sdp b/test/normal.sdp index 2173a3f..1025039 100644 --- a/test/normal.sdp +++ b/test/normal.sdp @@ -17,7 +17,7 @@ a=candidate:0 1 UDP 2113667327 203.0.113.1 54400 typ host a=candidate:1 2 UDP 2113667326 203.0.113.1 54401 typ host m=video 55400 RTP/SAVPF 97 98 a=rtpmap:97 H264/90000 -a=fmtp:97 profile-level-id=4d0028;packetization-mode=1 +a=fmtp:97 profile-level-id=4d0028;packetization-mode=1;sprop-parameter-sets=Z0IAH5WoFAFuQA==,aM48gA== a=fmtp:111 minptime=10; useinbandfec=1 a=rtpmap:98 VP8/90000 a=rtcp-fb:* nack diff --git a/test/parse.test.js b/test/parse.test.js index bcf29cf..187231a 100644 --- a/test/parse.test.js +++ b/test/parse.test.js @@ -65,6 +65,8 @@ exports.normalSdp = function (t) { var vidFmtp = parseFmtpConfig(video.fmtp[0].config); t.equal(vidFmtp['profile-level-id'], "4d0028", "video fmtp 0 profile-level-id"); t.equal(vidFmtp['packetization-mode'], 1, "video fmtp 0 packetization-mode"); + t.equal(vidFmtp['sprop-parameter-sets'], "Z0IAH5WoFAFuQA==,aM48gA==", + "video fmtp 0 sprop-parameter-sets"); t.equal(video.fmtp[1].payload, 111, "video fmtp 1 payload"); var vidFmtp2 = parseFmtpConfig(video.fmtp[1].config); t.equal(vidFmtp2.minptime, 10, "video fmtp 1 minptime");