我们正在评估Agora音频广播API。这是一个无线电广播应用程序,我们希望有我们的主机广播通过一个管理网页从我们的后端服务器服务。我们的后端服务器是否可以接收下面这样的事件回调:频道已创建。观众加入了频道。观众左频道
发布于 2020-06-18 11:56:26
当主机使用.join()函数加入通道时,您可以使用javascript的
var event = new Event('build');
// Listen for the event.
elem.addEventListener('build', function (e) { /* ... */ }, false);
// Dispatch the event.
elem.dispatchEvent(event);创建并触发“频道创建”事件。
我们已经有了一个“观众加入”的活动:
client.on('peer-online', function(evt) {
console.log('peer-online', evt.uid);
});当观众离开频道时,我们也有一个事件:
client.on("peer-leave", function(evt) {
var uid = evt.uid;
var reason = evt.reason;
console.log("remote user left ", uid, "reason: ", reason);
//……
});如果您有更多的疑问,请随时回复我们。
https://stackoverflow.com/questions/62422571
复制相似问题