(self, basestation, camera)
return self.TriggerAndHandleEvent(basestation, trigger, callback)
This function causes the camera to snapshot while recording.
        NOTE: You MUST call StartStream() before calling this function.
        If you call StartStream(), you have to start reading data from the stream, or streaming will be cancelled
        and taking a snapshot may fail (since it requires the stream to be active).

        NOTE: You should not use this function is you just want a snapshot and aren't intending to stream.
        Use TriggerFullFrameSnapshot() instead.

        NOTE: Use DownloadSnapshot() to download the actual image file.
This function causes the camera to snapshot while recording.
        NOTE: You MUST call StartStream() before calling this function.
        If you call StartStream(), you have to start reading data from the stream, or streaming will be cancelled
        and taking a snapshot may fail (since it requires the stream to be active).
This function causes the camera to snapshot while recording . NOTE : You MUST call StartStream () before calling this function . If you call StartStream () you have to start reading data from the stream or streaming will be cancelled and taking a snapshot may fail ( since it requires the stream to be active ) .
def TriggerStreamSnapshot(self, basestation, camera):
        """
        This function causes the camera to snapshot while recording.
        NOTE: You MUST call StartStream() before calling this function.
        If you call StartStream(), you have to start reading data from the stream, or streaming will be cancelled
        and taking a snapshot may fail (since it requires the stream to be active).

        NOTE: You should not use this function is you just want a snapshot and aren't intending to stream.
        Use TriggerFullFrameSnapshot() instead.

        NOTE: Use DownloadSnapshot() to download the actual image file.
        """
        def trigger(self):
            self.request.post(f'https://{self.BASE_URL}/hmsweb/users/devices/takeSnapshot', {'xcloudId':camera.get('xCloudId'),'parentId':camera.get('parentId'),'deviceId':camera.get('deviceId'),'olsonTimeZone':camera.get('properties', {}).get('olsonTimeZone')}, headers={"xcloudId":camera.get('xCloudId')})

        def callback(self, event):
            if event.get("deviceId") == camera.get("deviceId") and event.get("resource") == "mediaUploadNotification":
                presigned_content_url = event.get("presignedContentUrl")
                if presigned_content_url is not None:
                    return presigned_content_url

            return None

        return self.TriggerAndHandleEvent(basestation, trigger, callback)
def TriggerStreamSnapshot ( self , basestation , camera ) : def trigger ( self ) : self . request . post ( f'https://{self.BASE_URL}/hmsweb/users/devices/takeSnapshot' , { 'xcloudId' : camera . get ( 'xCloudId' ) , 'parentId' : camera . get ( 'parentId' ) , 'deviceId' : camera . get ( 'deviceId' ) , 'olsonTimeZone' : camera . get ( 'properties' , { } ) . get ( 'olsonTimeZone' ) } , headers = { "xcloudId" : camera . get ( 'xCloudId' ) } ) def callback ( self , event ) : if event . get ( "deviceId" ) == camera . get ( "deviceId" ) and event . get ( "resource" ) == "mediaUploadNotification" : presigned_content_url = event . get ( "presignedContentUrl" ) if presigned_content_url is not None : return presigned_content_url return None return self . TriggerAndHandleEvent ( basestation , trigger , callback )