douyan6548 2015-06-11 14:39
浏览 96
已采纳

将数据附加到simpleWebRTC房间或视频

I'm using simpleWebRTC for a multi-party video chat.

Each user creates his own room. When a user subscribes to another (in order to see this person 0 and registers in the db).

When a user chooses another - he gets this users username by XHR from the db.

I tried adding the data for the appropriate video (or room) - under the

webrtc.on('video added'......

Is there another way I can attach data to the video or room which is more reliable?

  • 写回答

1条回答 默认 最新

  • doumian3780 2015-06-15 12:28
    关注

    This was just added very recently. You can now set nick on the config options passed to the constructor, which will be included in onVideoAdded -

    var webrtc = new SimpleWebRTC({
         ... // your options here
         nick: 'my-user-id'
    });
    
    webrtc.on('videoAdded', function (peer) {
        //peer.nick is the other user's nick, and for them, this is yours
    });
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改