A HTML5 video player component for Vue.js

Demo

live demo is here: Hilongjw. Making. IO/vue – video/o…

Instllation

npm i vue-video --save-dev
Copy the code

Usage

// script import myVideo from 'vue-video' export default { data () { return { video: { sources: [{ src: 'http://covteam.u.qiniudn.com/oceans.mp4', type: 'video/mp4'}], the options: {the autoplay: true, volume: 0.6, poster: 'http://covteam.u.qiniudn.com/poster.png' } } } }, components: { myVideo } }Copy the code
Copy the code

API

sources

sources: [{
    // video uri
    src: 'http://covteam.u.qiniudn.com/oceans.mp4',
    // video meta type
    type: 'video/mp4'
}]

Copy the code

options

{// autoplay autoplay: true, // default Volume volume: 0.6, // poster (cover image) poster: 'http://covteam.u.qiniudn.com/poster.png' }Copy the code