# testor-jebussica

### 描述

```
基于Jessibuca，简单封装播放器。
```

## Use

```
npm i testor-jessibuca
```

### 静态资源

```
位置：public/static/jessibuca
文件：jessibuca.js
	 decoder-pro.js
	 decoder-pro.wasm

加载jessibuca.js，在index.html添加：
<script type="text/javascript" src="<%= BASE_URL %>static/jessibuca/jessibuca.js"></script>
```

### 使用说明

```
在main.js添加：

import JessibucaTestor from 'testor-jessibuca'
import 'testor-jessibuca/lib/testor-jessibuca.css'
Vue.use(JessibucaTestor)
```

### 参数说明

| 参数名     | 说明                                 | 类型     | 默认值 |
| ---------- | ------------------------------------ | -------- | ------ |
| videoUrl   | 视频流地址                           | string   | -      |
| videoError | 播放器错误回调方法                   | function | -      |
| replay     | 是否为回放，为true显示进度条，可拖动 | boolean  | false  |
| seekTime   | 回放视频时间全长，单位秒/s           | number   | 0      |
| stratTime  | 回放开始时间                         | string   | -      |
| hasAudio   | 是否有音频                           | boolean  | false  |

### 方法说明

| 方法       | 说明                         | 参数                       |
| ---------- | ---------------------------- | -------------------------- |
| changeTime | 在会放下，拖动进度条回调函数 | 拖动结束点的时间，单位秒/s |

### 示例

```javascript
<jessibucaTestor
    ref="jessibuca"
    :videoUrl="videoUrl"
    :error="videoError"
    :seekTime="time"
    :replay="isReplay"
    :stratTime="start"
    :hasAudio="false"
    fluent
    autoplay
    live
    @changeTime="changeStepTime"
    style="width: 50%;height: 50vh"
    ></jessibucaTestor>
```

