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

@devleaf-labs/vue-video-background

v1.0.7

Published

A Vue 3 component to easily create a background video of either Relative, Absolute or Fixed position, allowing you to post content over the top.

Downloads

9

Readme

vue-video-background

This component is created for > Vue 3 due to it using the composition API. Unfortunately Vue 2 is not supported due to Vue 3 being pretty widely used at this point. It shouldn't be difficult to take the source code for this component and translate it to Vue 2 however.

A component for Vue 3 to easily create a background video of either Relative, Absolute or Fixed position, allowing you to post content over the top. This component can accept multiple video sources, fallback image and even applies a fallback to iOS low power mode by using the playing event listener on component mounting to see if a pause happens.

The component also adheres to all browsers autoplay requirements with the following properties: playsinline autoplay muted loop

Installation

Install with NPM

npm i @devleaf-labs/vue-video-background

Use in your project

<script>
import VideoBackground from '@devleaf-labs/vue-video-background';
...
export default {
  components: { VideoBackground },
  ...
}
</script>

<template>
  <video-background src="your-video-source" />
</template>

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | src | String | - | The source of the video you want to play | | mime | String | 'video/mp4' | The MIME Type of the video you are trying to play | | fallback | String | - | A fallback image to display if the user is on low power mode or the video is loading | | lowBatterySupport | Boolean | true | Whether to support detection of iOS' Low Power Mode | | position | 'fixed' or 'relative' or 'absolute' | 'fixed' | The CSS position of the background video | | multiSrc | Array | - | An array of multiple video sources to display (cannot use with :src and :mime properties [see multiple sources below]) |

Using multiple sources for your video

If you want to have multiple sources on your video (for example WebM and MP4), you can do so using the :multiSrc prop, this takes an object of src and mime per video source and will place them in the order you pass them.

For Example:

<video-background
  :multiSrc="[{ src: './link-to-webm-video.webm', mime: 'video/webm' }, { src: './link-to-mp4-video.mp4', mime: 'video/mp4 }]"
/>

Will provide two sources, one WebM and the other MP4.

⚠️ Something to Note ⚠️

If you are using the :multiSrc prop you should not use :src and :mime as this will conflict with the prior. This will be handled gracefully by prioritising the :multiSrc over the :src but it should be seen as bad practice.

Closing Remarks

This project is supplied by Devleaf Studios' Open Source Labs initiative, and is therefore provided under the Apache 2.0 Licence, with no warranty. We will honor keeping the project alive but may require pull requests from time to time to keep this project up to date with the latest versions of Vue.