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

Function stop_screen_recording

packages/server/src/api/routes.rs:2538–2558  ·  view source on GitHub ↗
(
    State(state): State<AppState>,
    Path((udid, recording_id)): Path<(String, String)>,
)

Source from the content-addressed store, hash-verified

2536}
2537
2538async fn stop_screen_recording(
2539 State(state): State<AppState>,
2540 Path((udid, recording_id)): Path<(String, String)>,
2541) -> Result<(StatusCode, HeaderMap, Vec<u8>), AppError> {
2542 if android::is_android_id(&udid) {
2543 return Err(AppError::bad_request(
2544 "Screen recording is currently supported for iOS simulators only.",
2545 ));
2546 }
2547 let mp4 = run_bridge_action(state, move |bridge| {
2548 bridge.stop_screen_recording(&recording_id)
2549 })
2550 .await?;
2551 let mut headers = HeaderMap::new();
2552 headers.insert(header::CONTENT_TYPE, "video/mp4".parse().unwrap());
2553 headers.insert(
2554 header::CACHE_CONTROL,
2555 "no-cache, no-store, must-revalidate".parse().unwrap(),
2556 );
2557 Ok((StatusCode::OK, headers, mp4))
2558}
2559
2560fn validate_screen_recording_seconds(seconds: Option<f64>) -> Result<f64, AppError> {
2561 let seconds = seconds.unwrap_or(5.0);

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected