MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / screen_recording

Function screen_recording

packages/server/src/api/routes.rs:2497–2519  ·  view source on GitHub ↗
(
    State(state): State<AppState>,
    Path(udid): Path<String>,
    Json(payload): Json<ScreenRecordingPayload>,
)

Source from the content-addressed store, hash-verified

2495}
2496
2497async fn screen_recording(
2498 State(state): State<AppState>,
2499 Path(udid): Path<String>,
2500 Json(payload): Json<ScreenRecordingPayload>,
2501) -> Result<(StatusCode, HeaderMap, Vec<u8>), AppError> {
2502 let seconds = validate_screen_recording_seconds(payload.seconds)?;
2503 if android::is_android_id(&udid) {
2504 return Err(AppError::bad_request(
2505 "Screen recording is currently supported for iOS simulators only.",
2506 ));
2507 }
2508 let mp4 = run_bridge_action(state, move |bridge| {
2509 bridge.screen_recording_mp4(&udid, seconds)
2510 })
2511 .await?;
2512 let mut headers = HeaderMap::new();
2513 headers.insert(header::CONTENT_TYPE, "video/mp4".parse().unwrap());
2514 headers.insert(
2515 header::CACHE_CONTROL,
2516 "no-cache, no-store, must-revalidate".parse().unwrap(),
2517 );
2518 Ok((StatusCode::OK, headers, mp4))
2519}
2520
2521async fn start_screen_recording(
2522 State(state): State<AppState>,

Callers

nothing calls this directly

Calls 6

is_android_idFunction · 0.85
run_bridge_actionFunction · 0.85
screen_recording_mp4Method · 0.80
insertMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected