1.1.0 • Published 5 years ago

vue-video-tape v1.1.0

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

安装

npm install vue-video-tape

全局引入

improt VueVideoTape from "vue-video-tape";
Vue.use(VueVideoTape);

组件内引入

improt {VueVideoTape} from "vue-video-tape";

export default {
	components:{VueVideoTape}
}

属性

属性名属性值是否必填介绍
playerOptionsObjecttruevideo配置(参考videojs文档)
videoFileNameStringfalse录制视频结束后返回的文件名
screenshotedBooleanfalse当为true时,触发截图事件
startCapturedBooleanfalse当为true时,开始录制
stopCapturedBooleanfalse当为true时,停止录制

事件

事件名参数介绍
videoDataurl,file录制结束后触发,第一个参数是可以直接播放的url,第二个参数是返回的视频文件
imageDatabase64截图成功后触发,返回截图的base64

手动事件

如果觉得使用属性控制事件的方式比较麻烦,可以直接调用组件的事件进行操作.

事件名介绍
screenshot截图
startCapture开始录制
stopCapture结束录制

使用方法(通过ref属性,父组件调用子组件的方法):

<template>
    <div>
        <VueVideoTape 
		:playerOptions='options' 
		ref="videotape"
		@imageData="imageData"
		@videoData="videoData"
</VueVideoTape>
    </div>
</template>
<script>
import VueVideoTape from 'vue-video-tape'

export default { data(){ return{ options:{ width:600, sources: { src:'http://.........' } } } }, methods:{ image(){ //截图 this.$refs.videotape.screenshot(); }, start(){ //开始录制 this.$refs.videotape.startCapture(); }, stop(){ //结束录制 this.$refs.videotape.stopCapture(); },

	//截图成功回调事件
	imageData(base64){},

	//录制成功回调事件
	videoData(url,file){},
},
components:{
    VueVideoTape
}

}

1.1.0

5 years ago

1.0.28

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago