Language: 简体中文 / English
A vue component of barrages video player. Apply to PC web with static source video.
- Mainly: Volume and progress bar, multiple speed, fullscreen and page-fullcreen, picture in picture, barrages(partial)
- Keyboard control:(F) fullscreen, (↑↓) volume, (←→) progress bar, (Space) pause/resume
- Video format: Only supports video formats supported by native H5 Video. If you need to additionally support flv, mpegts, m2ts and other formats, you need to refer to other third-party libraries, such as [mpegts.js](https://github.com/xqq /mpegts.js);
- How to get video dom: Configure 'ref' and call videoDom attribute. For example, configure
ref="player"
and get the video dom throughthis.$refs.player[0].videoDom
.
- Format:Only supports the
xml barrage format of Bilibili
. For details of the format refer to this article. - Display: Supports scrolling, top fixed and bottom fixed barrages.
- Settings: waiting for development
- Multiplayer coexistence
- Barrage display
- Full screen with only web page
- Barrage settings
- Packaged for easier import
- Show video data and more tools by right click
- Multiple Language Support
- Live push stream
-
Adapt to mobile web
Notice: Download files in releases, and the project needs to import axios
.
Example codes: preview-videoplayer.vue
Import and use:
- Copy the four files under
src/components
to your project, make sure that these four files are kept in the same directory. - Copy
src/asset
s to yours/src
,the file "/src/assets/images/loading.svg
" is loading icon. - Minimal code example:
<template>
<barrageVideoplayer
:src="videoSrc"
width="100%"
height="100%"
></barrageVideoplayer>
</template>
<script>
import barrageVideoplayer from "../components/barrage-videoplayer.vue";
export default {
components: {barrageVideoplayer},
data() {
return {
videoSrc: "",
};
},
}
- (barrage-videoplayer.vue)
parameter | required/optional | type | default | more |
---|---|---|---|---|
src | required | String | null | Video source. |
cover | optional | String | null | Customize Cover image source. If null, show video default cover. |
primaryColor | optional | String | "cornflowerblue" | Theme color. Can use css attributes:colorName、#Hex、rgb、rgba、HSL、HSLA |
width | optional | String | 100% | Video width with css code. |
height | optional | String | 100% | Video height with css cod. |
speedList | optional | array | ["2.0", "1.5", "1.25", "1.0", "0.75", "0.5"] | Multiple play speed. Initialized to 1.0 |
biBarrageXml | optional | String | null | Barrages source with Bilibili XML format. If null will not support barrages. Need to deal with cross-domain issues. |
- issue
- contact me by email
npm install
npm run serve
npm run build
npm run lint