# Capture & Record

## UseCaptureRecord

{% embed url="<https://github.com/Off-Live/myty-sdk/blob/pre-release/dev/examples/react_2d_mp/react/src/hooks/useCaptureRecord.tsx>" %}

A React hook that enables capturing and recording on React application.&#x20;

### Image Capture

<mark style="color:purple;">`ReactUnityWebGL`</mark> provides screenshot feature(<https://react-unity-webgl.dev/docs/api/take-screenshot>). We utilize this function to create image capture feature. Since it only captures WebGL canvas, extra implementation has been made to include HeadOnly(AR) mode.

### Video Recording

<mark style="color:purple;">`MediaRecorder`</mark> from WebRTC (<https://developer.mozilla.org/en-US/docs/Web/API/MediaStream_Recording_API>) has been used to implement video recording feature. Simply, we record audio stream and video stream at the same time, and commit frames for video stream by capturing images for multiple times.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://myty.gitbook.io/products/sdk/react-example/capture-and-record.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
