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

Subscribe single stream

Daghe
Beginner
501 Views

There are three attendees in the room, just want to subscribe to one of them, how to get the stream and how to add  each stream into the custom layout, expecting to reply, thank you!

0 Kudos
7 Replies
Qiujiao_W_Intel
Employee
501 Views

After publishing a stream, published stream id will be notified by stream-added event and stream id will be included in callback, you can record the stream id. And also remote stream info can be fetched when user successfully join room, remote stream info will be included in callback info, please refer to join API. 
if you want to add each stream to different layout, you should have manage permission first (this permission can be defined for each role in session_agent/agent.toml), and then call conferenceClient.mix API to add stream to custom layout, please refer to mix API in js sdk document.

0 Kudos
Daghe
Beginner
501 Views

[how to save a single stream.id after stream-added event ,i just can known every stream.id and subscribe all of them or none of them?

when i subscribe the mixed stream, whether  can i  use setRegion  and mix API   to set layout ? How to deal with it ? Thanks !

0 Kudos
Qiujiao_W_Intel
Employee
501 Views

single stream id is returned on callback of stream-added event, you can call response.stream.id to get related id.

you can use conferenceClient.mix API first to add stream to mix stream, and then use conferenceClient.setRegion to set stream to specific area. For mix and setRegion API, please make sure you have manage permission for the role.

0 Kudos
Daghe
Beginner
501 Views

当流发布时,我设置发布的参数unmix为true,可以设置不混合,当我调用setRegion时,指定某个流ID,参数格式只能使用单引号包含流id,region参数一直提示invalid region_id  我设置的是“”region“” :'2' 当参会人数大于2时才能生效,设置权限是配置文件的哪个配置项,期待您的回复,谢谢

0 Kudos
Qiujiao_W_Intel
Employee
501 Views

Hi, 下面是我们的使用方法:

var options = {
    id: clientId,
    region: region,
    mixedStreamId: regionViewId
  };

权限设置是在session_agent/agent.toml里看你使用的role里是否有定义manage = true权限,默认的admin用户是有管理权限,请仔细阅读文档

0 Kudos
Daghe
Beginner
501 Views

localStreams数组保存本地流,ReomoteStreams保存远程流。join返回的resp.streams中是否保存已加入房间的每个流,当我调用SetRegion时region:'6'设置为6时房间内必须有6个流? 能否当房间只有单路流是设置在布局中指定的region,region设置的参数返回invalid region_id  or  Uncaught TypeError: Cannot read property 'region' of undefined  但是设置好像起作用了,请问如何设置setRegion中的参数?房间内的每路流是否可用resp.streams获取,期待回复,谢谢

0 Kudos
Daghe
Beginner
501 Views

使用的是admin权限,resp.stream数组第一个元素为房间号对应的mix流,没有得到刷新加入房间的流id

0 Kudos
Reply