---
name: "IpcPlayerContext.startRecord"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.8" }
title: "IpcContext.startRecord - 开始录像"
---

## IpcPlayerContext.startRecord

> [VERSION] Base Library >= 2.21.8

### Description

Start recording

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `options` | `IpcStartRecordOption` | No | Recording options |

### Return Value

None


### Referenced Types

##### `interface` IpcStartRecordOption

| Property | Type | Description |
| --- | --- | --- |
| `saveToAlbum` | `0 \| 1` | Whether to save to the album: 0 = do not save, 1 = save |
| `rotate` | `0 \| 1 \| 2 \| 3` | Rotation angle: 0 = no rotation, 1 = 90°, 2 = 180°, 3 = 270° |
| `success` | `() => void` | Callback invoked on successful API call |
| `fail` | `(result: IpcFailResult) => void` | Callback on failure |
| `complete` | `() => void` | Callback on complete (success or failure) |

##### `interface` IpcFailResult

| Property | Type | Description |
| --- | --- | --- |
| `errorCode` | `string` | Error code |
| `errorMsg` | `string` | Error message |


### Examples

#### Start recording

```ts
const ipcCtx = ty.createIpcPlayerContext('deviceId');
ipcCtx.startRecord({
  saveToAlbum: 0,
  success() {
    console.log('Recording started');
  },
});
```
