# vue-video-control

> A html5 video player component of vue. Include video controller / video preview / power progress bar / danmaku and so on

Latest version **0.3.1** (published 2020-07-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-video-control
pnpm add vue-video-control
yarn add vue-video-control
bun add vue-video-control
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2020-07-16 |
| First published | 2020-06-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.5 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | geminate |
| Maintainers | geminate |
| Keywords | vue, video, player |

## Links

- npm: https://www.npmjs.com/package/vue-video-control
- Repository: https://github.com/geminate/vue-video-control
- Homepage: https://github.com/geminate/vue-video-control#readme
- Issues: https://github.com/geminate/vue-video-control/issues
- npm.io page: https://npm.io/package/vue-video-control

## Dependencies (2)

- [vue](https://npm.io/package/vue.md) ^2.6.11
- [core-js](https://npm.io/package/core-js.md) ^3.6.5

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.3.1 (latest) — 2020-07-16
- 0.2.1 — 2020-06-30
- 0.1.2 — 2020-06-30
- 0.1.1 — 2020-06-29
- 0.1.0 — 2020-06-24

## README

vue-video-control [![npm](https://img.shields.io/npm/v/vue-video-control)](https://www.npmjs.com/package/vue-video-control) [![npm](https://img.shields.io/npm/l/vue-video-control)](https://www.npmjs.com/package/vue-video-control)
======

A html5 video player component of vue. 

Include video controller / video preview / power progress bar / danmaku and so on

## Install

You can install vue-video-control by npm.

```javascript
$ npm install vue-video-control
```
[cnpm](https://github.com/cnpm/cnpm) mirror is recommended if you are in Mainland China.

## Getting Started

* Import vue-video-control at main.js

```js
import VideoControl from 'vue-video-control'

Vue.use(VideoControl)
```

* Set options at pages

```vue
<template>
  <video-control ref="videoControl" class="video-control" :options="videoOptions"></video-control>
</template>

<script>
  export default {
    data () {
      return {
        videoOptions: {
          src: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'
        }
      }
    }
  }
</script>
```

## Options

| options                        | type     | default                | instruction
| --------                       | -----    | -----                  | -----
| src                            | string   | ''                     | Indicates media URL
| autoplay                       | boolean  | false                  | Do auto play the video
| poster                         | string   | ''                     | The poster image url of video
| control.show                   | boolean  | true                   | Display control bar
| control.focusPreview.show      | boolean  | false                  | Display focus preview bar
| control.focusPreview.data      | array    | [1]                    | The data array of focus preview bar 
| control.videoPreview.show      | boolean  | false                  | Display video preview image
| control.videoPreview.imgUrl    | string   | ''                     | The image url of video preview.The image must be an single line sprite image and each of the part should be 160*90. See /public/video-preview.jpg 
| control.videoPreview.totalNum  | number   | 10                     | Number of the sprite image 
| control.videoTimer.show        | boolean  | true                   | Display video <current time / duration> timer 
| control.speedBtn.show          | boolean  | true                   | Display the button to change playback speed
| control.speedBtn.speedArray    | array    | [0.5, 0.75, 1, 1.5, 2] | Playback speed options
| control.volumeBtn.show         | boolean  | true                   | Display the button to change volume
| control.fullScreenBtn.show     | boolean  | true                   | Display the button to toggle full screen
| danmaku.show                   | boolean  | true                   | Display the danmaku and danmaku control
| danmaku.fontSize               | number   | 25                     | The font size of danmaku
| danmaku.rowNum                 | number   | 5                      | The maximum number of lines of danmaku
| danmaku.speed                  | number   | 80                     | Rolling speed of danmaku
| danmaku.data                   | array    | []                     | Danmaku data array
| danmaku.onSendDanmaku          | Function |                        | Triggered after the danmaku is sent


## Methods

#### .refreshOptions()
```js
this.videoOptions.control.focusPreview.data = await getData()
this.videoOptions.control.focusPreview.show = true
this.$refs.videoControl.refreshOptions()
```
Refresh the component options

## Events

#### play / pause / loadStart / canPlay / canplaythrough / waiting / playing / progress / durationChange / seeking / seeked / timeUpdate / ended / error / rateChange / volumeChange
See [Media events](https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events)

---
_Source: https://npm.io/package/vue-video-control · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
