Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.