# saveVideoToLocal

> 保存视频到本地

### saveVideoToLocal

> 保存视频到本地

#### 请求参数

| 参数       | 类型                          | 必填 | 说明         |
| ---------- | ----------------------------- | ---- | ------------ |
| `videoUrl` | `string`                      | 是   | 视频网络地址 |
| `success`  | `() => void`                  | 否   | 成功回调     |
| `fail`     | `(error: BridgeCode) => void` | 否   | 失败回调     |
| `complete` | `() => void`                  | 否   | 完成回调     |

#### 返回值

```js
Promise<void>
```

#### 异常返回值

```js
Promise<{ errCode: BridgeCode }>
```

#### 示例代码

```js
import { saveVideoToLocal } from '@kbapp/js-bridge'

saveVideoToLocal({
    videoUrl: 'https://example.com/video.mp4',
    success() {
        console.log('保存视频成功')
    },
    fail(error) {
        console.log('保存视频失败', error)
    },
})
```

> 支持 Promise 风格调用
