Browse Source

webrtc work

split-pipe
Hendrik Langer 4 years ago
parent
commit
64def00511
  1. 6
      raspberry/roberto/views/websocket/routes.py
  2. 7
      raspberry/roberto/views/websocket/templates/camera.html

6
raspberry/roberto/views/websocket/routes.py

@ -91,8 +91,8 @@ def disconnect():
def connect():
sid = request.sid
print("Received Connect message from %s" % sid)
socketio.emit('ready', room=ROOM, namespace='/webrtc', skip_sid=sid)
join_room(ROOM)
if not webrtccamera.connected:
webrtccamera.connect(socketio, ROOM, 'gstwebrtc1000')
#socketio.emit('ready', room=ROOM, namespace='/webrtc', skip_sid=sid)
socketio.emit('ready', room=ROOM, namespace='/webrtc')
join_room(ROOM)

7
raspberry/roberto/views/websocket/templates/camera.html

@ -36,7 +36,12 @@
socket.on('data', (data) => {
console.log('Data received: ',data);
var json_data = JSON.parse(data);
var json_data;
if (typeof data === 'string') {
json_data = JSON.parse(data);
} else {
json_data = data;
}
handleSignalingData(json_data);
});

Loading…
Cancel
Save