KinesteX

Camera Component Parameters

Parameters that are only read by the Camera component (createCameraComponent, Swift createCameraView, IntegrationOption.CAMERA, route /camera). Other integration options ignore them. For the full guide, see Camera Component.


ParameterTypeDefaultWhat it does internally
exercisesstring[]requiredThe exercise models to download at launch, in the form set by exerciseFetchType. Only these (plus any added later with load_models) can become currentExercise. Replies: models_loaded (modelIds), and error_occurred (critical, "Failed to fetch N model(s): ...") for ids that fail. In the URL: a JSON array
currentExercisestringnoneThe exercise to track, from exercises. Change it at runtime to switch tracking; it also takes the commands "Pause Exercise", "Stop Camera", "Pause Audio", "Resume Audio" and "Workout Overview". See Workout Activity Actions
exerciseFetchTypestring"model_id"How each value in exercises (and in load_models) is looked up: "model_id", "exercise_id" or "exercise_title". An invalid value falls back to the backend default
restSpeechesstring[]noneRest-speech phrases (each exercise's rest_speech from the Content API) to download at launch, so currentRestSpeech can play them at once. In the URL: a JSON array
currentRestSpeechstringnonePlays one of the restSpeeches (only when restSpeeches was sent at launch). Send "Stop audio" to stop the current sound. Change it at runtime like currentExercise; sending the same phrase twice in a row plays it once
pauseCamerabooleanfalseOpens with the camera off, as if pause_camera had been sent: models still load and model_warmedup still fires. Send resume_camera to turn the camera on. No echo for the launch value. Accepts true or "true"
muteWorkoutbooleanfalseStarts the session muted, as if mute_workout had been sent (for this session only, not saved). Send unmute_workout to unmute. No echo for the launch value. Accepts true or "true"

Runtime control (all through workout_activity_action, see Workout Activity Actions):

  • load_models fetches and caches more models without reloading; the ids that load can then become currentExercise (guide).
  • get_exercise_setup answers with one exercise_setup per exercise: start position, camera view and side (guide).
  • pause_camera / resume_camera and mute_workout / unmute_workout turn the camera and the sound off and on (guide).
  • reset_progress, reset_all_progress and reset_check_frame restart the current exercise, the whole session or the positioning check without reloading.

Real-time events: the Camera component sends reps, form state, presence, framing and gesture events as they happen. Their launch options are in Real-Time Motion Events.


Related parameters that also work here: videoURL (Testing & Simulation); landmarkColor, showSilhouette, videoFit, isDrawingPose, includePoseBorders, showFormGuidance, streamFormGuidance, cameraLabel, shouldShowCameraSelector (Camera & Pose Detection); hideConnectTvButton, checkFrameText (UI Controls).

Camera Component Launch
Swift example:
1@State private var currentExercise = "model-id-1"
2@State private var currentRestSpeech: String? = nil
3
4kinestex.createCameraView(
5    exercises: ["model-id-1", "model-id-2"],
6    currentExercise: $currentExercise, // change it to switch exercises
7    currentRestSpeech: $currentRestSpeech, // set it to play a rest speech
8    user: nil,
9    style: nil,
10    isLoading: $isLoading,
11    customParams: [
12        "exerciseFetchType": "model_id",
13        "restSpeeches": ["Get ready for squats"],
14        "pauseCamera": true, // camera off until resume_camera
15        "muteWorkout": true // muted until unmute_workout
16    ],
17    onMessageReceived: { message in /* ... */ }
18)