npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue3-canvas-video-player

v1.2.3

Published

Video player that operates on Vue3 and uses canvas

Downloads

725

Readme

Vue3 Canvas Video Player

Canvas-based video player available on Vue3. If you enter FPS, it operates in frames. You can set the range and visualize the image recognition bounding-box data.

Demo

Streaming videos may have delays. Local video files are recommended.

Usage

Install

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

Component

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

<template>
  <Vue3CanvasVideoPlayer
    :src="'video.mp4'" // ''
    :muted="true" // false
    :autoplay="true" // false
    :loop="true" // false
    :range="[10, 20]" // [0, 0]
    :fps="30" // 0
    :bbox="{
      data: {
        100: [{ label: 'stone', xywh: [0, 200, 100, 400] }, { label: 'flower', xywh: [50, 250, 150, 450] }],
        101: [{ label: 'stone', xywh: [1, 201, 101, 401] }, { label: 'flower', xywh: [51, 251, 151, 451] }],
        102: [{ label: 'stone', xywh: [2, 202, 102, 402] }, { label: 'flower', xywh: [52, 252, 152, 452] }],
      },
      textColor: '#fff',
      fillColor: 'rgba(0, 0, 255, 0.5)',
      borderSize: 1,
      borderColor: 'rgba(255, 0, 0, 0.5)',
    }" // { data: {}, textColor: '#fff', fillColor: 'rgba(0, 0, 255, 0.5)', borderSize: 1, borderColor: 'rgba(255, 0, 0, 0.5)' }; } }
    :type="'contain'" // 'overlay'
    :messageTime="1000" // 1000
    :preview="true" // false
    :darkMode="true" // true
    @loadedmetadata="(event) => console.log('loadedmetadata', event)"
    @play="(event) => console.log('play', event)"
    @pause="(event) => console.log('pause', event)"
    @timeupdate="(event) => console.log('timeupdate', event)"
    @volumechange="(event) => console.log('volumechange', event)"
    @error="(event) => console.log('error', event)"
  />
</template>

Props

src

Path to the video source file.

muted

Defines the start-up mute state.

autoplay

Automatically play video at startup. It only works when it is muted.

loop

Which controls whether the media element should start over when it reaches the end.

range

Use seconds to set the range of the beginning and end of the video.

image

fps

When you enter the FPS for the video, it operates in frames.

image

bbox

Visualize the image recognition bounding-box data. You can change the line thickness, fill and line color. It only works when use FPS.

image

type

You can use 'contain' mode to prevent the controller from covering the screen, or 'overlay' mode for movie viewing.

image

messageTime

Sets the time when messages displayed in the center of the screen disappear. No message is displayed when 0.

image

preview

Displays a preview in the seek bar.

image

darkMode

Use dark or light mode.

image

Events

loadedmetadata

The loadedmetadata event is fired when the metadata has been loaded.

play

The play event is fired when the paused property is changed from true to false, as a result of the play method, or the autoplay attribute.

pause

The pause event is sent when a request to pause an activity is handled and the activity has entered its paused state, most commonly after the media has been paused through a call to the element's pause() method.

The event is sent once the pause() method returns and after the media element's paused property has been changed to true.

timeupdate

The timeupdate event is fired when the time indicated by the currentTime attribute has been updated.

The event frequency is dependent on the system load, but will be thrown between about 4Hz and 66Hz (assuming the event handlers don't take longer than 250ms to run). User agents are encouraged to vary the frequency of the event based on the system load and the average cost of processing the event each time, so that the UI updates are not any more frequent than the user agent can comfortably handle while decoding the video.

volumechange

The volumechange event is fired when the volume has changed.

error

The error event is fired when the resource could not be loaded due to an error (for example, a network connectivity problem).

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)

License

MIT