---
name: "IpcPlayerContext"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.8" }
title: "IpcContext"
---

## IpcPlayerContext

> [VERSION] Base Library >= 2.21.8

> 💡 IpcContext is bound by device ID to an ipc-player component and controls the corresponding IPC camera device. Supports preview, intercom, recording, snapshot, and more.

### Description

IpcContext instance, obtainable via ty.createIpcPlayerContext

### Parameters

None


### Return Value

Type: `IpcPlayerContext`

IpcPlayerContext instance

#### Methods

| Method | Description |
| --- | --- |
| `connect` | Connect to the IPC device |
| `disconnect` | Disconnect from the IPC device |
| `startPreview` | Start preview |
| `stopPreview` | Stop preview |
| `snapshot` | Capture snapshot |
| `setMuted` | Set mute state |
| `setSoundMode` | Set audio mode |
| `setClarity` | Set quality |
| `startTalk` | Start intercom |
| `stopTalk` | Stop intercom |
| `isTalkBacking` | Check if intercom is active |
| `startRecord` | Start recording |
| `stopRecord` | Stop recording |
| `isRecording` | Check if recording is active |
| `setAvailableRockerDirections` | Set available joystick directions |
| `setTrackingStatus` | Set motion tracking status |
| `getVideoInfo` | Get video information |
| `isMuted` | Query mute status |
| `setMessageVideoPlaySpeed` | Variable-speed video playback message |

### Examples

#### Basic usage

```ts
Page({
  onReady() {
    const ipcCtx = ty.createIpcPlayerContext('deviceId');
    ipcCtx.connect({
      success() {
        ipcCtx.startPreview();
      },
    });
  },
});
```
