Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
better-video-embeds
Advanced tools
Pass in a url that should be a video embed link...and get back a properly formated embed link. (Works for YouTube, Vimeo, Wistia and more!)
Pass in a url that should be a video embed link...and get back a properly formated embed link. (Works for YouTube, Vimeo, Wistia and more!)
npm i better-file-downloader
yarn add better-file-downloader
For example:
https://www.youtube.com/watch?v=O9ydMYA8dmw
becomes https://www.youtube.com/embed/O9ydMYA8dmw
The api currently supports parsing out the following embed strings:
The library works with react and is fairly lightweight in size.
You'll be converting your users dirty video links scripts into embed links that you can iframe in no time!
import getEmbedUrl from 'better-video-embeds';
const getEmbedUrl = require('better-video-embeds');
const embedLink = getEmbedUrl('https://www.youtube.com/watch?v=O9ydMYA8dmw');
import getEmbedUrl from 'better-video-embeds';
const getEmbedUrl = require('better-video-embeds');
const embedLink = getEmbedUrl('https://www.youtube.com/watch?v=O9ydMYA8dmw', {
includeModestYouTubeBranding: true,
});
import React, { useState } from 'react';
import getEmbedUrl from 'better-video-embeds';
export default function example() {
const [videoLink, setVideoLink] = useState('');
const submit = event => {
event.preventDefault();
const embedLink = getEmbedUrl(videoLink);
console.log(embedLink);
};
return (
<form onSubmit={submit}>
<input
value={videoLink}
type="text"
onChange={event => setVideoLink(event.target.value)}
/>
<button type="submit">Save!</button>
</form>
);
}
FAQs
Pass in a url that should be a video embed link...and get back a properly formated embed link. (Works for YouTube, Vimeo, Wistia and more!)
The npm package better-video-embeds receives a total of 227 weekly downloads. As such, better-video-embeds popularity was classified as not popular.
We found that better-video-embeds 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.