Vue3 Canvas Video Player

Usage

Install

npm install --save vue3-canvas-video-player

Component

<script>
import Vue3CanvasVideoPlayer from 'vue3-canvas-video-player';
import 'vue3-canvas-video-player/dist/style.css';
</script>

<template>
  <Vue3CanvasVideoPlayer
    :src="'video.mp4'"
    :muted="true"
    :autoplay="true"
    :range="[10, 20]"
    :fps="30"
    :bbox="{
      data: {
        100: [0, 200, 100, 400],
        101: [10, 210, 110, 410],
        102: [20, 220, 120, 420],
      },
      borderSize: 1,
      borderColor: 'rgba(255, 0, 0, 0.5)',
      fillColor: 'rgba(0, 0, 255, 0.5)',
    }"
    :type="'contain'"
    :messageTime="1000"
    :preview="true"
    :darkMode="true"
  />
</template>

Props

src

video source path

default ''

muted

muted volume

default false

autoplay

autoplay video (when muted)

default false

range

range seconds ex [1.2, 3.4]

default []

image

fps

fps (use 0 to disable)

default 0

image

bbox

bounding box (fps required)

default {}

image

type

player style overlay, contain

default overlay

image

messageTime

message time (use 0 to disable)

default 1000

image

preview

preview on seek bar

default false

image

darkMode

use dark mode

default true

image

Shortcuts

Keys Description
ctrl + alt + ArrowUp Volume up
ctrl + alt + ArrowDown Volume down
ctrl + alt + ArrowLeft Prev second or frame
ctrl + alt + ArrowRight Next second or frame
ctrl + alt + g Go to frame (fps required)

GitHub

View Github