
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
vue-responsive-video
Advanced tools
A video element that will swap out the source file base on screen width
A video element that will swap out its src
based on the size of the window.
With a <picture>
element you can provide multiple <source>
child elements and use the media
attribute on them to control when each one is used.
However, with the <video>
, while it does support the <source>
element as a child, it doesn't support the media
attribute on its children.
This is annoying and leaves us with the challenge of finding a way to not provide huge videos to mobile devices.
This package tries to provide a way to do that.
npm install --save vue-responsive-video
# or
yarn add vue-responsive-video
First, add the component to your project. This code may vary depending on your setup.
import VueResponsiveVideo from 'vue-responsive-video';
Vue.component('responsive-video', VueResponsiveVideo);
<responsive-video
mobile-src="my-video-sml.mp4"
desktop-src="my-video-med.mp4"
></responsive-video>
Currently we're only supporting 2 sizes but we should be able to refactor it to support an arbitrary number of sizes.
An issue on iOS Safari 15 has meant that we can't provide a poster attribute which means we have no fallback if videos fail to play.
FAQs
A video element that will swap out the source file base on screen width
The npm package vue-responsive-video receives a total of 3 weekly downloads. As such, vue-responsive-video popularity was classified as not popular.
We found that vue-responsive-video demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.