1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2025-06-30 05:31:07 +02:00

Parse JSON from server SDP

This commit is contained in:
Alexandre Iooss
2020-10-22 08:23:35 +02:00
parent ba8bf426e0
commit a2a74761bb
3 changed files with 7 additions and 7 deletions

View File

@ -55,9 +55,9 @@ export class GsWebSocket {
*/
onDescription(callback) {
this.socket.addEventListener("message", (event) => {
// FIXME: json to session description
console.log("Message from server ", event.data);
callback(event.data);
const sdp = new RTCSessionDescription(JSON.parse(event.data));
callback(sdp);
});
}
}