---
name: "IpcPlayerContext.getVideoInfo"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.8" }
title: "IpcContext.getVideoInfo - 获取视频信息"
---

## IpcPlayerContext.getVideoInfo

> [VERSION] Base Library >= 2.21.8

### Description

Get video information

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `options` | `IpcGetVideoInfoOption` | No | Callback configuration |

### Return Value

None


### Referenced Types

##### `interface` IpcGetVideoInfoOption

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

##### `interface` IpcVideoInfoResult

| Property | Type | Description |
| --- | --- | --- |
| `width` | `number` | Video width |
| `height` | `number` | Video height |

##### `interface` IpcFailResult

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


### Examples

#### Get video information

```ts
const ipcCtx = ty.createIpcPlayerContext('deviceId');
ipcCtx.getVideoInfo({
  success(res) {
    console.log('Video width', res.width);
    console.log('Video height', res.height);
  },
});
```
