是的,他们在网站上有一个演示,您必须注册才能尝试。 http://www.pubnub.com/developers/webrtc/
看起来您使用 WebRTC 库编写代码,并且以 PubNub 方式,PubNub 库提供订阅和侦听新连接的方法。 (PubNub 库具有查看用户在线和离线的功能。)这是您要找的吗?一种能够呼叫可用用户的聊天状态?如果是这样,使用 PubNub 可能是个好主意。
如果您真的是 WebRTC 初学者并且正在尝试在您的 Joomla 网站用户之间进行基本的视频通话,您可以尝试开源 SIP.js (sipjs.com) 和 OnSIP。这是在 WebRTC 和 SIP 之上编写的。您可以在 getonsip.com 上获得快速用户。像这样进行视频通话的样子(在页面加载时开始通话,单击结束按钮结束通话):
在 HTML 中
<script src="http://sipjs.com/download/sip-0.6.3.min.js">
<video id="remoteVideo"></video>
<video id="localVideo" muted="muted"></video>
<button id="endCall">End Call</button>
在 JavaScript 中:
var session;
var endButton = document.getElementById('endCall');
endButton.addEventListener("click", function () {
session.bye();
alert("Call Ended");
}, false);
//Creates the anonymous user agent so that you can make calls
var userAgent = new SIP.UA();
//here you determine whether the call has video and audio
var options = {
media: {
constraints: {
audio: true,
video: true
},
render: {
remote: {
video: document.getElementById('remoteVideo')
},
local: {
video: document.getElementById('localVideo')
}
}
}
};
//makes the call
session = userAgent.invite('sip:youruser@yourdomain.onsip.com', options);
您可以在 getonsip.com 上注册一个快速用户地址并登录到终点。