def delete_button(self, camera_id): widget = self.camera_scroll_area_widget_contents.findChild(QtWidgets.QWidget, camera_id) api = ServerApi('http://127.0.0.1:5000') resp = api.rtsp_finish(camera_id) if resp.status_code == 200: widget.setParent(None)
def rtsp_released(self): sending_button = self.main_self.sender() api = ServerApi('http://127.0.0.1:5000') if sending_button.text() == 'Start stream': resp = api.rtsp_start(sending_button.property('id').get('id')) print('start rtsp ', str(resp.status_code)) if resp.status_code == 200 or resp.status_code == '200': sending_button.setText('Stop stream') else: resp = api.rtsp_finish(sending_button.property('id').get('id')) print('start rtsp ', str(resp.status_code)) if resp.status_code == 200 or resp.status_code == '200': sending_button.setText('Start stream')