Skip to content

WebRTC not working in Chrome #195

@CharlemagneLasse

Description

@CharlemagneLasse

When I run a webrtc stream in chrome, I always get the error (in the webdevtools console):

[WebrtcCamerastreamerCamera] failed to start playback "Top" OperationError: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to parse SessionDescription. a=msid: video Missing stream ID in msid attribute.
    at u.loadStream (WebrtcCamerastreamerCamera-T0M-JDAw.js:1:1870)

Problem is the reply from the iceserver which contains following:

...a=ssrc:1994510237 msid: video\r\na=msid: video\r\n...

Instead of an actual msid (after the msid: prefix), there is just an empty string followed by a space. This is not valid according to

Culprit for this are the lines:

Empty msids are not valid. It works when (PoC) changing it to:

diff --git a/output/webrtc/webrtc.cc b/output/webrtc/webrtc.cc
index f2232b3..d94f048 100644
--- a/output/webrtc/webrtc.cc
+++ b/output/webrtc/webrtc.cc
@@ -417,7 +417,7 @@ static void http_webrtc_request(http_worker_t *worker, FILE *stream, const nlohm
   auto client = webrtc_peer_connection(webrtc_configuration, message);
   LOG_INFO(client.get(), "Stream requested.");
 
-  client->video = webrtc_add_video(client->pc, webrtc_client_video_payload_type, rand(), "video", "");
+  client->video = webrtc_add_video(client->pc, webrtc_client_video_payload_type, rand(), "video", "camerastreamer");
 
   try {
     {
@@ -490,7 +490,7 @@ static void http_webrtc_offer(http_worker_t *worker, FILE *stream, const nlohman
   LOG_VERBOSE(client.get(), "Remote SDP Offer: %s", std::string(message["sdp"]).c_str());
 
   try {
-    client->video = webrtc_add_video(client->pc, webrtc_client_video_payload_type, rand(), "video", "");
+    client->video = webrtc_add_video(client->pc, webrtc_client_video_payload_type, rand(), "video", "camerastreamer");
 
     {
       std::unique_lock lock(client->lock);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions