> For the complete documentation index, see [llms.txt](https://myty.gitbook.io/products/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://myty.gitbook.io/products/sdk/react-example/capture-and-record.md).

# 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.
