Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IonSFUJSONRPCSignal加入自定义数据接收 #163

Open
aixinaxc opened this issue Feb 16, 2021 · 2 comments
Open

IonSFUJSONRPCSignal加入自定义数据接收 #163

aixinaxc opened this issue Feb 16, 2021 · 2 comments

Comments

@aixinaxc
Copy link

通过signal中的call或者notify可以发送自定义的数据。看源码websocket被保护了,无法使用原生事件。
那该如何接收后台广播的自定义数据。从而实现一些定制化功能

@aixinaxc
Copy link
Author

开放自定义数据接收后,也可以在远端设备断开时,通知其他设备把该设备流清除掉

@ChenSino
Copy link

signal里面有个socket属性,用这个可以发送自定义事件,今天刚好看到。
this.signal.socket.onmessage= (ev)=>{ const method = JSON.parse(ev.data).method const data = JSON.parse(ev.data).params.data switch (method) { case 'onChat': console.log(JSON.parse(ev.data).params.data); break } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants