Intel® Collaboration Suite for WebRTC
Community support and discussions on the Intel® Collaboration Suite for WebRTC (Intel® CS for WebRTC).

Subscribe only works with camera permission granted.

Stephen_-_
New Contributor I
909 Views

Hi... I know this is a long shot, but I just wanted to see if anyone could help me. I'm still on 4.2.1, but I think the issue was happening before then.

This is how I do my subscribing on the javascript client: 

________

    async function subscribeTo(stream,options){
    makeCamBox(stream);
    if (typeof options == "undefined"){
        let videocodec = stream.settings.video.codec.name;
        options = {audio: false,video:{codecs:[{name:videocodec}]}}
    };
var subscription;
    try{
        subscription = await conference.subscribe(stream,options);
        subscription.streamId = stream.id; //stream id and subscription id are different, so we need this to know where it came from.
        subscription.origin = stream.origin;
        BC.subscriptions.push(subscription);
        subscription.addEventListener('ended', function(){console.log(subscription.id + ' (subscription) has ended.'); BC.tools.removeFromSubscriptions(subscription);})
        
    }
    catch(err){console.error('subscribe failed', err); //alert(err);
    //now remove the errored cambox still loading status..
    removeLoadingCamboxByStreamId(stream.id);

}
    showSubscribedStream(subscription);

}

_______

So basically, you pass it the stream you want to subscribe to, it makes a box for it to go with makeCamBox().
It all works 100% in firefox.

But with chrome, and safari (desktop, iOS and iPadOS), it will ONLY work if the site has already been granted permission to access the user's own webcam. The user's webcam doesn't need to be already opened or transmitted either, just with that granted previously. So clearly some sort of thing is going on with permissions, where camera permissions kind of elevates what is allowed.

The "subscription = await conference.subscribe(stream,options);" Never ever resolves or finishes or even gives any error in the logs at all. It just kind of hangs. But if the site has camera permissions, then it works PERFECTLY.

And the box from the makeCamBox() stays on the screen and is never removed with "removeLoadingCamboxByStreamId" because an error is never fired.

I'm not 100% sure if it's related to the problem but I think maybe the "dtlsState" is staying as "connecting" under chrome://webrtc-internals ??

___

It's not good for my site, because new users who join want to be able to receive streams before they ever give my site permission to access their webcam. And if they don't have a webcam plugged in at all, then there is no way at all to view incoming streams at all.

What might I be doing wrong? Any idea appreciated!

0 Kudos
4 Replies
Stephen_-_
New Contributor I
909 Views

Here are the separate websocket messages that occur client side when unable to subscribe to a new stream. They are all downstream messages unless i marked them as UPSTREAM.

42["stream",{"id":"161060986993090780","status":"add","data":{"id":"161060986993090780","type":"forward","media":{"video":{"status":"active","format":{"codec":"h264","profile":"CB"},"source":"camera","parameters":{"resolution":{"width":320,"height":240},"framerate":20},"optional":{"format":[{"codec":"vp8"},{"codec":"vp9"}],"parameters":{"resolution":[{"width":240,"height":180},{"width":212,"height":160},{"width":160,"height":120},{"width":106,"height":80},{"width":80,"height":60}],"framerate":[6,12,15],"bitrate":["x0.8","x0.6","x0.4","x0.2"],"keyFrameInterval":[100,30,5,2,1]}}}},"info":{"type":"webrtc","owner":"wLiEkGDdtINxDvwdACEj","attributes":{"boop":"booop"},"inViews":[]}}}]

UPSTREAM 4213["subscribe",{"media":{"audio":false,"video":{"from":"161060986993090780"}}}]

42["stream",{"id":"161060986993090780","status":"update","data":{"field":".","value":{"id":"161060986993090780","type":"forward","media":{"video":{"status":"active","format":{"codec":"h264","profile":"CB"},"source":"camera","parameters":{"resolution":{"width":320,"height":240},"framerate":20},"optional":{"format":[{"codec":"vp8"},{"codec":"vp9"}],"parameters":{"resolution":[{"width":240,"height":180},{"width":212,"height":160},{"width":160,"height":120},{"width":106,"height":80},{"width":80,"height":60}],"framerate":[6,12,15],"bitrate":["x0.8","x0.6","x0.4","x0.2"],"keyFrameInterval":[100,30,5,2,1]}}}},"info":{"type":"webrtc","owner":"wLiEkGDdtINxDvwdACEj","attributes":{"boop":"booop"},"inViews":[]}}}}]

42["stream",{"status":"update","id":"5cb31a8ac38a6317f5aaa638-common","data":{"field":"video.layout","value":[{"stream":"501879822513532160","region":{"id":"1","shape":"rectangle","area":{"left":"0/2","top":"0/2","width":"1/2","height":"1/2"}}},{"stream":"958786022266061200","region":{"id":"2","shape":"rectangle","area":{"left":"1/2","top":"0/2","width":"1/2","height":"1/2"}}},{"stream":"161060986993090780","region":{"id":"3","shape":"rectangle","area":{"left":"0/2","top":"1/2","width":"1/2","height":"1/2"}}},{"stream":null,"region":{"id":"4","shape":"rectangle","area":{"left":"1/2","top":"1/2","width":"1/2","height":"1/2"}}}]}}]

4313["ok",{"id":"277310238844408860"}]

UPSTREAM 4214["soac",{"id":"277310238844408860","signaling":{"type":"offer","sdp":"v=0\r\no=- 8108285311443841530 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=msid-semantic: WMS\r\nm=video 9 UDP/TLS/RTP/SAVPF 102 127 125 108 124 123 114 116 122 121 107 109 120 119 115\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:EcKi\r\na=ice-pwd:ABYX8I+41YyScIHnVRmW+RM/\r\na=ice-options:trickle\r\na=fingerprint:sha-256 9B:34:13:B8:AC:7C:59:89:0E:BC:72:AD:3D:AD:9D:70:33:99:6D:18:D9:9B:3A:76:48:7C:41:EA:50:22:9D:29\r\na=setup:actpass\r\na=mid:0\r\na=extmap:14 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:13 urn:3gpp:video-orientation\r\na=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:12 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:11 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type\r\na=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing\r\na=extmap:8 http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07\r\na=extmap:9 http://www.webrtc.org/experiments/rtp-hdrext/color-space\r\na=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\na=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id\r\na=recvonly\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:102 H264/90000\r\na=rtcp-fb:102 goog-remb\r\na=rtcp-fb:102 transport-cc\r\na=rtcp-fb:102 ccm fir\r\na=rtcp-fb:102 nack\r\na=rtcp-fb:102 nack pli\r\na=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f\r\na=rtpmap:122 rtx/90000\r\na=fmtp:122 apt=102\r\na=rtpmap:127 H264/90000\r\na=rtcp-fb:127 goog-remb\r\na=rtcp-fb:127 transport-cc\r\na=rtcp-fb:127 ccm fir\r\na=rtcp-fb:127 nack\r\na=rtcp-fb:127 nack pli\r\na=fmtp:127 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f\r\na=rtpmap:121 rtx/90000\r\na=fmtp:121 apt=127\r\na=rtpmap:125 H264/90000\r\na=rtcp-fb:125 goog-remb\r\na=rtcp-fb:125 transport-cc\r\na=rtcp-fb:125 ccm fir\r\na=rtcp-fb:125 nack\r\na=rtcp-fb:125 nack pli\r\na=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\na=rtpmap:107 rtx/90000\r\na=fmtp:107 apt=125\r\na=rtpmap:108 H264/90000\r\na=rtcp-fb:108 goog-remb\r\na=rtcp-fb:108 transport-cc\r\na=rtcp-fb:108 ccm fir\r\na=rtcp-fb:108 nack\r\na=rtcp-fb:108 nack pli\r\na=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f\r\na=rtpmap:109 rtx/90000\r\na=fmtp:109 apt=108\r\na=rtpmap:124 H264/90000\r\na=rtcp-fb:124 goog-remb\r\na=rtcp-fb:124 transport-cc\r\na=rtcp-fb:124 ccm fir\r\na=rtcp-fb:124 nack\r\na=rtcp-fb:124 nack pli\r\na=fmtp:124 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d0032\r\na=rtpmap:120 rtx/90000\r\na=fmtp:120 apt=124\r\na=rtpmap:123 H264/90000\r\na=rtcp-fb:123 goog-remb\r\na=rtcp-fb:123 transport-cc\r\na=rtcp-fb:123 ccm fir\r\na=rtcp-fb:123 nack\r\na=rtcp-fb:123 nack pli\r\na=fmtp:123 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640032\r\na=rtpmap:119 rtx/90000\r\na=fmtp:119 apt=123\r\na=rtpmap:114 red/90000\r\na=rtpmap:115 rtx/90000\r\na=fmtp:115 apt=114\r\na=rtpmap:116 ulpfec/90000\r\n"}}]

4314["ok"]

42["progress",{"id":"277310238844408860","status":"soac","data":{"type":"answer","sdp":"v=0\no=- 0 0 IN IP4 127.0.0.1\ns=IntelWebRTCMCU\nt=0 0\na=group:BUNDLE 0\na=msid-semantic: WMS UamQbz0qBS\nm=video 1 UDP/TLS/RTP/SAVPF 125 114\nc=IN IP4 0.0.0.0\na=rtcp:1 IN IP4 0.0.0.0\na=candidate:2 1 udp 2013266431 198.27.81.159 34576 typ host\na=ice-ufrag:Xzgc\na=ice-pwd:sJjZaBoV3pYe9XqnB5yR5g\na=extmap:14 urn:ietf:params:rtp-hdrext:toffset\na=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\na=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\na=fingerprint:sha-256 7B:2A:47:98:10:23:F0:76:BE:9C:FE:D8:63:89:0F:E4:65:22:61:98:9D:9F:4C:D8:84:77:C3:93:AE:46:6D:74\na=setup:active\na=sendonly\na=mid:0\na=rtcp-mux\na=rtpmap:125 H264/90000\na=rtcp-fb:125 ccm fir\na=rtcp-fb:125 transport-cc\na=rtcp-fb:125 nack\na=rtcp-fb:125 goog-remb\na=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\na=rtpmap:114 red/90000\na=ssrc:913503042 cname:o/i14u9pJrxRKAsu\na=ssrc:913503042 msid:UamQbz0qBS v0\na=ssrc:913503042 mslabel:UamQbz0qBS\na=ssrc:913503042 label:UamQbz0qBSv0\n"}}]

UPSTREAM 4215["soac",{"id":"277310238844408860","signaling":{"type":"candidate","candidate":{"candidate":"a=candidate:821175674 1 udp 2113937151 5caf3a96-2f81-412e-ad8c-97c2ff8c3962.local 50014 typ host generation 0 ufrag EcKi network-cost 999","sdpMid":"0","sdpMLineIndex":0}}}]

4315["ok"]

 

And then the javascript console just shows this:

main.js:70 A new stream is added  161060986993090780
main.js:1031 The layout for mix stream '5cb31a8ac38a6317f5aaa638-common' has changed.
owt.js:9 Empty candidate.
owt.js:9 ICE connection state changed to checking
owt.js:9 Remote stream added.
owt.js:9 ICE connection state changed to connected

 

I hope that can help a bit :\

again: works perfectly as long as the browser has been granted access to webcam. As soon as the webcam access has been granted, new subscriptions start working fine on the page without any refresh at all, and the old ones never get resolved.

0 Kudos
Nikhil_kumar__Doosar
909 Views

Hi Team,

Even I am facing with the same issue but please help me regarding the same, this issue blocker for broadcasting the steam.

 

Thanks 

Nikhil 

0 Kudos
Nikhil_kumar__Doosar
909 Views

Hello Team,

Any help would be appreciated.

Best Regards,
Nikhil

0 Kudos
Jayaram_Kurapati
Beginner
910 Views

Hi Team,

Even I am facing with the same issue. Please help.

Thanks,
Jayaram.

0 Kudos
Reply