2014-07-08 25 views

回答

0

如果您的相机和麦克风连接到系统时,你应该能够看到和听到自己

+0

这应该是一个答案或批评。 –

0

你可以连接到一个会话作为出版商和检查stream.hasVideo ...

例子:

session.connect(userToken, function() { 
    var publisherProperties = {insertMode: "append", width: $('#publisher-tokbox').width(), height: $('#publisher-tokbox').height()}; 

    var publisher = OT.initPublisher('publisher-tokbox', publisherProperties, function (error) { 
     if (error) { 
      console.log(error); 
     } 
     else { 
      console.log("Publisher initialized."); 
     } 
    }); 
    publisher.on("streamCreated", function (event) { 
     console.log("The publisher started streaming.", event); 
     if (event.stream.hasVideo) { 
      console.log("Video is present"); 
     } 

    }); 

    self.set('publisher', publisher); 
    session.publish(publisher); 
}); 

注意,用户需要授予他的浏览器设置访问摄像机。

相关问题