提交 61cdf636 authored 作者: Chad Phillips's avatar Chad Phillips

FS-11286: Add onRemoteStream callback to Verto dialogs

This patch adds an onRemoteStream callback, which can be specified on the Verto
instance, or per dialog. The callback is fired when the remote stream from a
call is received, and receives two arguments, the first is the remote stream,
the second is the Verto dialog object.
上级 d5af9296
......@@ -189,6 +189,11 @@
doCallback(self, "onStream", stream);
}
function onRemoteStreamSuccess(self, stream) {
console.log("Remote Stream Success");
doCallback(self, "onRemoteStream", stream);
}
function onICE(self, candidate) {
self.mediaData.candidate = candidate;
self.mediaData.candidateList.push(self.mediaData.candidate);
......@@ -259,6 +264,7 @@
//self.options.useAudio.play();
self.remoteStream = stream;
onRemoteStreamSuccess(self, stream);
}
function onOfferSDP(self, sdp) {
......
......@@ -2060,6 +2060,13 @@
console.log("stream started");
};
RTCcallbacks.onRemoteStream = function(rtc, stream) {
if (typeof dialog.callbacks.onRemoteStream === 'function') {
dialog.callbacks.onRemoteStream(stream, dialog);
}
console.log("remote stream started");
};
RTCcallbacks.onError = function(e) {
if (dialog.verto.options.permissionCallback &&
typeof dialog.verto.options.permissionCallback.onDenied === 'function'){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论