MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / peerSession

Method peerSession

src/astroprint/plugin/services/camera.py:71–95  ·  view source on GitHub ↗
(self,data,sendResponse)

Source from the content-addressed store, hash-verified

69 sendResponse('error_init_janus',True)
70
71 def peerSession(self,data,sendResponse):
72
73 action = data['action']
74
75 if data and 'sessionId' in data:
76 sessionId = data['sessionId']
77
78 if action == 'init_peer_session':
79 #Initialize the peer session
80 if cameraManager().startLocalVideoSession(sessionId):
81 sendResponse({'success': 'no-error'})
82 else:
83 sendResponse('error_init_peer_session',True)
84
85 #elif request.method == 'DELETE':
86 elif action == 'close_peer_session':
87 #Close peer session
88 if cameraManager().closeLocalVideoSession(sessionId):
89 sendResponse({'success': 'no-error'})
90
91 else:
92 sendResponse('error_close_peer_session',True)
93
94 else:
95 sendResponse('error_no_session_id',True)
96
97 def startStreaming(self,data,sendResponse):
98 webRtcManager().startVideoStream()

Callers

nothing calls this directly

Calls 3

cameraManagerFunction · 0.90

Tested by

no test coverage detected