All Projects → fashen007 → canvas-merge-video-in-vue

fashen007 / canvas-merge-video-in-vue

Licence: other
canvas+vue 实现视频碎片合并 比较粗陋,欢迎fork 升级++

Programming Languages

javascript
184084 projects - #8 most used programming language
Vue
7211 projects
HTML
75241 projects

Projects that are alternatives of or similar to canvas-merge-video-in-vue

Ccapture.js
A library to capture canvas-based animations at a fixed framerate
Stars: ✭ 2,836 (+13404.76%)
Mutual labels:  canvas
Chart.js
Simple HTML5 Charts using the <canvas> tag
Stars: ✭ 55,646 (+264880.95%)
Mutual labels:  canvas
radiaSlider
circular/linear knob-style slider
Stars: ✭ 18 (-14.29%)
Mutual labels:  canvas
Hermite Resize
Canvas image resize/resample using Hermite filter with JavaScript.
Stars: ✭ 246 (+1071.43%)
Mutual labels:  canvas
Disintegrate
A small JS library to break DOM elements into animated Canvas particles.
Stars: ✭ 251 (+1095.24%)
Mutual labels:  canvas
flappy-bird
🐦 A clone of a famous game, the Flappy Bird, made in Javascript and HTML Canvas API.
Stars: ✭ 37 (+76.19%)
Mutual labels:  canvas
Go Space Chat
【孤单Lonely】基于Golang/WebSocket/Canvas/Protobuf 的聊天室
Stars: ✭ 228 (+985.71%)
Mutual labels:  canvas
NightSky
A way to avoid paying 50 bucks by using some js to generate an image of the night sky at specific time and location. 🌑
Stars: ✭ 49 (+133.33%)
Mutual labels:  canvas
Rough
Create graphics with a hand-drawn, sketchy, appearance
Stars: ✭ 16,472 (+78338.1%)
Mutual labels:  canvas
canvas2video
canvas2video is a backend solution for creating and rendering dynamic videos.
Stars: ✭ 194 (+823.81%)
Mutual labels:  canvas
Demo
前端的一些小demo,包括几种布局以及一些特效
Stars: ✭ 248 (+1080.95%)
Mutual labels:  canvas
Clchart
A fast, simple and cross-platform(html5 react-native weex wechat-applet) stock chart library created using canvas.
Stars: ✭ 250 (+1090.48%)
Mutual labels:  canvas
downscale
Better image downscale with canvas.
Stars: ✭ 80 (+280.95%)
Mutual labels:  canvas
Canvas
A Laravel publishing platform
Stars: ✭ 2,838 (+13414.29%)
Mutual labels:  canvas
shoot game
🎮 It is a game using HTML5 Canvas and Vanilla JavaScript.
Stars: ✭ 35 (+66.67%)
Mutual labels:  canvas
Ol3echarts
🌏 📊 ol3Echarts | a openlayers extension to echarts
Stars: ✭ 229 (+990.48%)
Mutual labels:  canvas
Three.js
JavaScript 3D Library.
Stars: ✭ 78,237 (+372457.14%)
Mutual labels:  canvas
snake-game-p5
The Snake Game made with p5.js 🐍🎮.
Stars: ✭ 18 (-14.29%)
Mutual labels:  canvas
canvas-cast
Cast any <canvas> element to an LED Matrix over WebSockets with an Arduino/ESP8266.
Stars: ✭ 39 (+85.71%)
Mutual labels:  canvas
fabricjs-image-editor-origin
fabric.js javascript image editor
Stars: ✭ 52 (+147.62%)
Mutual labels:  canvas

新项目推荐 https://github.com/spademan/seamlessCanvasPlayer 【播放器】

canvas-merge-video-in-vue

##demo

##一.组件形式使用

###组件引入方式

1.npm install canvasmergevideo --save

###html文件中

import MergeVideo from 'canvasmergevideo'
Vue.use(MergeVideo)

<template>
  <div id="app">
    <merge-video :playList='playList' :autoPlay='autoPlay' :audioSrc='audioSrc'></merge-video>
  </div>
</template>

autoPlay: false, // 是否自动播放 Boolean(required)
playList: [] // 碎片列表 Array()
sounds: Number// 声音 Number(非必填)
audioSrc: String// 第三方声音(必填)

picOption: { // 水印配置
  editLogo: false, // // 是否需要调整水印
  logoSrc: require('./assets/logo.png'), //水印地址
  info: {
    w: 60, // 宽
    h: 60, // 高
    x: 0 // logo相对画布x轴起点
    y: 0 // logo相对画布y轴起点
  }
},

###另外需要引入 elmenet-ui的css

// 因为我后续在拓展的时候需要用到element-ui所以引入了这个ui
// 在项目的开始
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-default/index.css">

##二. fork项目跑起来 (想自己改造源码的同学可以看这个步骤)

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

此pro注意点:

1.并没有考虑性能
2.只支持温柔使用
3.没有catch error状态
4.loading状态正在完善中

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

组件内部默认data对象说明

progress: 0, // 进度条
allLength: 0, // 总长度.这个是需要后端返回的
currentTimeLabel: '0:00', // 默认播放时间 用来显示
terminalTimeLabel: '', // 终点时间
currentTime: 0, // 当前时间
currentIndex: 0, // 默认当前播放碎片指引
currentEnoughToPlay: false, // 表示是否需要显示enoughToPlay状态
loading: true, // loading状态
videoPauseing: true, // 暂停状态
audioPlaying: false, // 音频播放状态
mutedable: false, // 是否静音
videoInstance: null, // 当前激活的视频实例
canvasInstance: null // canvas 实

实现思路

1.先把所有视频碎片丢到dom里面

2.控制当前碎片指引,进行实例dom切换

3.videocurrentTime只要video能播放就会改变,通过这个属性监控触发 canvasdrawimage

4.通过canvasdrawimage去抓取当前碎片(也就是指引指向的那个video实例)

5.通过videoonend事件连接碎片

存在问题

1.来回拖动进度条的时候可能会出现卡顿现象视频 报错

2.兼容性问题

3.移动端播放全屏有兼容性问题

参考

https://www.w3.org/2010/05/video/mediaevents.html

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].