---
name: "IpcPlayerContext.stopPreview"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.8" }
title: "IpcContext.stopPreview - 停止预览"
---

## IpcPlayerContext.stopPreview

> [VERSION] Base Library >= 2.21.8

### Description

Stop preview

### Parameters

`Params`

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

### Return Value

None


### Referenced Types

##### `interface` IpcCallbackOption

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | `() => void` | No | Callback invoked on successful API call |
| `fail` | `(result: IpcFailResult) => void` | No | Callback on failure |
| `complete` | `() => void` | No | Callback on complete (success or failure) |

##### `interface` IpcFailResult

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


### Examples

#### Stop preview

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