RTCPeerconnection MediaConstraints

1,206 views
Skip to first unread message

José Luis Millán

unread,
Oct 6, 2012, 12:17:35 PM10/6/12
to discuss...@googlegroups.com
Hi all,

RTPeerconnection API defines many places where MediaConstraints can be
used. Which is the correct way to specify the video/audio constraints
(true/false) in RTPeerconnection offer creation?

createOffer() does accept an optional MediaConstraints argument. Is
this the correct place to specify it? How would this constraint be
speficied? ({video:true, audio:false}, etc)

Regards,

Vikas

unread,
Oct 8, 2012, 1:03:43 PM10/8/12
to discuss-webrtc
Hi,

Yes, you can specify media constraints in CreateOffer() api and
CreateAnswer api's. Something like below for RTCPeerConnection:-
var mediaConstraints = {'has_audio':true, 'has_video':true};
pc.createOffer(setLocalAndSendMessage, null, mediaConstraints);

You can also refer to the apprtc demo code (https://
apprtc.appspot.com/).

/Vikas

José Luis Millán

unread,
Oct 8, 2012, 1:19:42 PM10/8/12
to discuss...@googlegroups.com
Thanks Vikas,

I had already tested that and also ({audio:true, video:false}) but
does't work in Version 24.0.1284.2 dev.

Regards

2012/10/8 Vikas <vikasm...@webrtc.org>:
> --
>
>
>

Vikas Marwaha

unread,
Oct 8, 2012, 2:23:25 PM10/8/12
to discuss...@googlegroups.com
Sorry, It looks like this has not been implemented for RTCPeerConnection. Please see:-


/Vikas

>
> --
>
>
>

--




Justin Uberti

unread,
Oct 8, 2012, 3:48:09 PM10/8/12
to discuss-webrtc
For now, you could workaround by manually stripping out the m=video section from the generated SDP.


--
 
 
 

José Luis Millán

unread,
Oct 8, 2012, 4:39:11 PM10/8/12
to discuss...@googlegroups.com
Ok,

Thanks.


2012/10/8 Justin Uberti <jub...@google.com>:
> --
>
>
>
Reply all
Reply to author
Forward
0 new messages