1.tomcat版本:apache-tomcat-7.0.32
2.如果你想实现WebSocket必须得用Tomcat7及以上版本,并且引入:catalina.jar,tomcat-coyote.jar两个JAR包,
部署到Tomcat7之后得要去webapps/应用下面去删除这两个AR包否则无法启动
3.var mediaConstraints = {
'has_audio' : true,
'has_video' : true
};这个变量在浏览器里报错,替换成下面的写法
var mediaConstraints = {
"mandatory": {
"OfferToReceiveAudio": true,
"OfferToReceiveVideo": true
}
};
4.把stream.videoTracks和stream.audioTracks都换成get*****Tracks(),注意首字母大写。
5.pc.createAnswer(setLocalAndSendMessage, null, mediaConstraints);
pc.createOffer(setLocalAndSendMessage, null, mediaConstraints);
以上两行中的null替换成存在的回调函数,新建回调函数
function setRemoteAndSendMessage(sessionDescription){
pc.setRemoteDescription(sessionDescription);
}
1