---
name: "IpcPlayerContext.startPreview"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.8" }
title: "IpcContext.startPreview - 开始预览"
---

## IpcPlayerContext.startPreview

> [VERSION] Base Library >= 2.21.8

### Description

Start preview

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `options` | `IpcCallbackOption` | No | Callback options |

### Return Value

None


### Referenced Types

##### `interface` IpcCallbackOption

| Property | Type | Description |
| --- | --- | --- |
| `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 preview

```ts
const ipcCtx = ty.createIpcPlayerContext('deviceId');
ipcCtx.startPreview({
  success() {
    console.log('Preview started');
  },
});
```
