vue-multi-player
A video player for private
3,754
| Install | |
|---|---|
npm install vue-multi-player@1.0.1 |
|
| Latest Version: | 1.0.1 |
| Vue: | 2 |
| License: | MIT |
| Last Updated: | May 29, 2024 |
| Links: | npm |
Maintainer: wg_publish
Vue Multi Player
A multi-channel video player for Wisdom Garden
Getting Started
We provide a vue plugin to use the multi-player component in your own vue project. Currently only supports live mode
Installing
You can install it via NPM.
$ npm install vue-multi-player-demo --save
Using
Generally configured in the webpack entry page main.js as follows:
//requires
import Vue from 'vue';
//import vue-multi-player
import multiPlayer from 'vue-multi-player-demo';
import 'vue-multi-player-demo/dist/styles/multi-player.css';
//use multiPlayer
Vue.use(multiPlayer);
Then you can use multi-player component in your own vue component.
Usage
<template>
<div id="app">
<multi-player :mode='mode' :videos='videos' :autoPlay='autoPlay'></multi-player>
</div>
</template>
<script>
export default {
name: 'App',
data(){
return {
mode: 'live',
videos: [{
'src': 'http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8',
'type': 'application/x-mpegURL',
},{
'src': 'http://ivi.bupt.edu.cn/hls/cctv3hd.m3u8',
'type': 'application/x-mpegURL',
},{
'src': 'http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8',
'type': 'application/x-mpegURL',
}],
autoPlay: true
}
}
}
</script>
Properties
| property | type | default | description |
|---|---|---|---|
videos |
Array |
require |
video link collection played by multi-player |
mode |
String |
live |
player mode, only support live mode |
autoPlay |
Boolean |
false |
When set to true, the live video will automatically play in silent mode, this property is only applicable to live mode |
volume |
Number |
0.8 |
0 - 1, Set the initial volume of the player |
Live Player Event
Player Event
| event | parameter | required | description |
|---|---|---|---|
track:player:status |
status |
require |
Track player current status |
Give an example
<template>
<multi-player v-on="multiPlayerListeners"/>
</template>
export default {
computed: {
multiPlayerListeners() {
return Object.assign({}, this.$listeners, {
'track:player:status': this.setStatus
});
}
},
methods:{
setStatus(status) {
// here is your player status
console.log(status)
}
}
}
Change log
2020-05-08
- Support single-screen live video full-screen viewing
2020-03-09
- Support multi-channel broadcast live
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 1.0.1 | ~2.6.11 | MIT | |
| 1.0.0 | ~2.6.11 | MIT | |
| 0.0.3 | ^2.5.11 | MIT | |
| 0.0.2 | ^2.5.11 | MIT | |
| 0.0.1 | ^2.5.11 | MIT |
Pre-releases (153)
| Version | Released | Vue | License |
|---|---|---|---|
| 3.0.26-beta.6 | ^2.6.11 | MIT | |
| 3.0.26-beta.5 | ^2.6.11 | MIT | |
| 3.0.26-beta.4 | ^2.6.11 | MIT | |
| 3.0.26-beta.3 | ^2.6.11 | MIT | |
| 3.0.26-beta.2 | ^2.6.11 | MIT | |
| 3.0.26-beta.1 | ^2.6.11 | MIT | |
| 3.0.26-beta.0 | ^2.6.11 | MIT | |
| 3.0.26-beta | ^2.6.11 | MIT | |
| 3.0.25-beta.0 | ^2.6.11 | MIT | |
| 3.0.24-beta.0 | ^2.6.11 | MIT | |
| 3.0.23-beta.0 | ^2.6.11 | MIT | |
| 3.0.22-beta.0 | ^2.6.11 | MIT | |
| 3.0.21-beta.0 | ^2.6.11 | MIT | |
| 3.0.20-beta.0 | ^2.6.11 | MIT | |
| 3.0.19-beta.0 | ^2.6.11 | MIT | |
| 3.0.18-beta.0 | ^2.6.11 | MIT | |
| 3.0.17-beta.0 | ^2.6.11 | MIT | |
| 3.0.16-beta.0 | ^2.6.11 | MIT | |
| 3.0.15-beta.0 | ^2.6.11 | MIT | |
| 3.0.14-beta.0 | ^2.6.11 | MIT | |
| 3.0.13-beta.0 | ^2.6.11 | MIT | |
| 3.0.12-beta.0 | ^2.6.11 | MIT | |
| 3.0.11-beta.0 | ^2.6.11 | MIT | |
| 3.0.10-beta.0 | ^2.6.11 | MIT | |
| 3.0.9-beta.0 | ^2.6.11 | MIT | |
| 3.0.8-beta.0 | ^2.6.11 | MIT | |
| 3.0.7-beta.0 | ^2.6.11 | MIT | |
| 3.0.6-beta.0 | ^2.6.11 | MIT | |
| 3.0.5-beta.0 | ^2.6.11 | MIT | |
| 3.0.4-beta.0 | ^2.6.11 | MIT |
Showing the latest 30 of 153. See every release on npm