0.4.6 • Published 6 years ago

vue-video-module v0.4.6

Weekly downloads
113
License
ISC
Repository
github
Last release
6 years ago

GitHub issues GitHub forks GitHub stars

NPM

NPM

vue-video-module

A simple video component built for vue.

Work fine on IE 11+, Chrome, firefox, ipad and it's mobile friendly.

Warning

For umd users, due to webpack2 compile changes. The module export compile way changes, so you have no choice but set VueVideo = VueVideo.default at the begining.

Changelog

v0.4.6

🐛 Bug Fix

Log Page

Example

Demo Page

Test

Test Page

Usage

Install vue-video-module

npm install vue-video-module -D

Vue use

// import
import Vue from 'vue';
import VueVideo from 'vue-video-module';

// require
var Vue = require('Vue');
var VueVideo = require('vue-video-module');

// mount with component
export default {
  components: {
    VueVideo,
  },
};

Use in component

<div class="video-container">
  <vue-video ref="video1" :options="videoOptions"></vue-video>
</div>
// e.g
videoOptions: {
  src: 'http://vjs.zencdn.net/v/oceans.mp4',
  poster: 'http://www.freemake.com/blog/wp-content/uploads/2015/06/videojs-logo.jpg',
  controlBar: true,
  spinner: 'circles',
  fullscreen: true,
},

API

Props

Below are properties you can use in videoOptions to construct your own video.

If the value is false means this part will not be rendered.

NameDescriptionValueDefault
srcthe source of videostring (required)null
posterthe poster of the videostring || falsefalse
playMainthe source of main play buttonstring || falsebase64
playMainRolloverthe source of main play button rollover statestring || falsebase64
replayMainthe source of main replay buttonstring || falsebase64
replayMainRolloverthe source of main replay button rollover statestring || falsebase64
playSubthe source of play button in the video control barstringbase64
pauseSubthe source of pause button in the video control barstringbase64
replaySubthe source of replay button in the video control barstringbase64
fullscreenif fullscreen part shownbooltrue
fullscreenSubthe source of full screen button in the video control barstring || falsebase64
shrinkscreenSubthe source to shrink screen to normal size, button in the video control barstringbase64
autoPlayif the video auto playboolfalse
looploop videoboolfalse
mutedmuted videoboolfalse
controlBarif show the controlbarbooltrue
spinnerthe loading style, check herestring'circles'
volumeshow the volume controllerbooltrue
aspectdefine the video's width and height, an object with 'width' and 'height' property, see example4 for detailsobject || falsefalse
endFrameshow when last frame is shownstring || falsefalse
bufferingBarshow the buffering state of the videoboolfalse
timeProgressshow currentTime & totalTime when playingboolfalse

Events

brief:

the vueVideo is the object of this component

vueVideo.$refs.video is the dom of the video

// e.g
<vue-video :options="videoOptions" ref="video" @init="initHandler"></vue-video>
NameDescriptionType
init(vueVideo)be called after the video is initialed. PS: if the video src is changed, this event will fire again.function
play(vueVideo)video status from pause to playfunction
pause(vueVideo)video status from play to pausefunction
start(vueVideo)video startfunction
end(vueVideo)video endfunction

Methods

brief:

the vueVideo is the object of this component

// e.g
vueVideo.play();
NameDescriptionparameter
play()make the video playnull
pause()make the video pausenull
replay()make the video replaynull
seek(rate)0 <= rate <= 1, jump to a ponitnumber
change(options)if you want to the props after you create it, use this function.object
reset()reset to original statenull
loadPoster()process to load the posternull

Todo List

  • add options for manually set width and height
  • add last frame
  • add buffering state to progress bar
0.4.6

6 years ago

0.4.5

7 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.6

7 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.2

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.0

7 years ago