remotivelabs.broker.recording_session
There is a RecordingSessionClient for managing recording session playback on the broker.
import asyncio
from remotivelabs.broker.recording_session import RecordingSessionClient
async def main() -> None:
# Create a recording session client
async with RecordingSessionClient(url="http://127.0.0.1:50051") as rs_client:
# List available recording files on the broker
files = await rs_client.list_recording_files()
print(f"Available recording files: {files}")
# open a recording session with the first file
rs_ref = rs_client.get_session(str(files[0]))
async with rs_ref as session:
# start playback
status = await session.play()
print(f"Playback started with status: {status}")
# exiting the async with block will close the session, but playback will continue if other sessions are open
if __name__ == "__main__":
asyncio.run(main())
Represents a file or folder on the broker's file system.
Playback repeat settings.
Playback modes for a recording session.
Represents a recording session playback on the broker.
Open recording session for playback. If force_reopen is True, close any existing session before opening.
Arguments:
- force_reopen: Whether to force close any existing session before opening.
Returns:
The playback status after opening the session.
Raises:
- RecordingSessionPlaybackError: On failures to open the session.
Start or continue playback of an open recording session.
Arguments:
- offset: The offset in microseconds from which to start playback. If None, playback continues from the current position.
Returns:
The playback status after starting playback.
Raises:
- RecordingSessionPlaybackError: On playback errors
Pause playback of an open recording session.
Arguments:
- offset: Target position in microseconds at where the playback cursor is put after pausing.
Returns:
The playback status after pausing playback.
Raises:
- RecordingSessionPlaybackError: On playback errors
Move playback to a target offset within the currently open recording session.
Arguments:
- offset: Target position in microseconds.
Returns:
The playback status after seeking.
Raises:
- RecordingSessionPlaybackError: On playback errors
Set repeat mode for the currently open recording session.
Arguments:
- start_offset: Start offset in microseconds for the repeat segment. If None, repeat from the start of the recording.
- end_offset: End offset in microseconds for the repeat segment. If None, repeat until the end of the recording.
Note:
If both
start_offsetandend_offsetare None, repeat mode will be removed.
Returns:
The playback status after setting repeat mode.
Client for managing recording session playback on the broker.
List recording files in a directory.
Arguments:
- path: Optional path to the subdirectory containing the recording files.
Returns:
A list of File objects representing the recording files.
Get continuous status of all open recording sessions.
Returns:
An async iterator yielding lists of
RecordingSessionPlaybackStatusobjects.
Return a RecordingSession for the given path.
Arguments:
- path: The path to the recording session file.
- force_reopen: Whether to force close any existing session before opening.
Returns:
A
RecordingSessionobject.
Exception raised for errors during recording session playback.
Represents the playback status of a recording session.