0

我刚刚将 vline 添加到我的 php5/jQuery 门户中。

一切似乎都很好,但有一件让我发疯的事情。

假设有两个用户通过 vline 互相呼叫。用户 1 呼叫用户 2,用户 2 接听,一段时间后用户 2 挂断电话。用户 1 仍然可以看到视频面板,他无法关闭它。

如果用户 2 拒绝呼叫,用户 1 会看到视频面板,也会发生这种情况。

有人可以帮我解决这个问题吗?

谢谢

4

1 回答 1

1

I finally managed to make it work by doing the following:

  • Added a video-wrapper <div> to my html
  • Created the vline client by passing in this option "uiVideoPanel": "video-wrapper"
  • handled the following events

    • enterState:incoming
    • enterState:outgoing
    • enterState:closed

as follows:

client = vline.Client.create({
    "serviceId": serviceId,
    "ui": true,
    "uiVideoPanel": "video-wrapper"
});

client.on('enterState:incoming', handleShowWrapper).
on('enterState:outgoing', handleShowWrapper).
on('enterState:closed', handleHideWrapper);

function handleShowWrapper(event) {
    $("#video-wrapper").show();
}

function handleHideWrapper(event) {
    $("#video-wrapper").html("");
    $("#video-wrapper").hide();
}

Obviously it's a workaround but at least it make the call flow work properly.

Let me know if someone has a more elegant solution or if vline manage to solve it and the workaround is no more needed.

Thanks

于 2014-04-16T10:26:48.757 回答