![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@social-embed/lib
Advanced tools
URL detection and parsing for embed providers (YouTube, other OEmbed compatible providers),
@social-embed/lib
· A lightweight, browser-friendly utility that parses common media URLs (YouTube, Vimeo, Spotify, etc.) and converts them into embeddable links or extracts relevant IDs.
NPM:
npm i @social-embed/lib
yarn:
yarn add @social-embed/lib
pnpm:
pnpm add @social-embed/lib
If your environment supports ESM or direct URL imports, you can pull from a CDN:
unpkg:
import { getYouTubeIdFromUrl } from "https://www.unpkg.com/@social-embed/lib?module";
skypack:
import { getYouTubeIdFromUrl } from "https://cdn.skypack.dev/@social-embed/lib";
Below is a simple TypeScript example demonstrating some core functions:
import {
convertUrlToEmbedUrl,
getYouTubeIdFromUrl,
getDailyMotionIdFromUrl,
getDailyMotionEmbedFromId,
} from "@social-embed/lib";
// 1. Convert any recognized media URL into its embeddable form
console.log(
convertUrlToEmbedUrl("https://www.youtube.com/watch?v=Bd8_vO5zrjo"),
);
// Output: "https://www.youtube.com/embed/Bd8_vO5zrjo"
// 2. Extract YouTube video ID
console.log(getYouTubeIdFromUrl("https://youtu.be/Bd8_vO5zrjo"));
// Output: "Bd8_vO5zrjo"
// 3. DailyMotion usage
console.log(
getDailyMotionIdFromUrl("https://www.dailymotion.com/video/x7znrd0"),
);
// Output: "x7znrd0"
console.log(getDailyMotionEmbedFromId("x7znrd0"));
// Output: "https://www.dailymotion.com/embed/video/x7znrd0"
Spotify
console.log(convertUrlToEmbedUrl("spotify:album:1DFixLWuPkv3KT3TnV35m3"));
// "https://open.spotify.com/embed/album/1DFixLWuPkv3KT3TnV35m3"
Vimeo
console.log(convertUrlToEmbedUrl("vimeo.com/channels/staffpicks/134668506"));
// "https://player.vimeo.com/video/134668506"
Loom
console.log(
convertUrlToEmbedUrl("loom.com/share/e883f70b219a49f6ba7fbeac71a72604"),
);
// "https://www.loom.com/embed/e883f70b219a49f6ba7fbeac71a72604"
EdPuzzle
console.log(
convertUrlToEmbedUrl("edpuzzle.com/media/606b413369971e424ec6021e"),
);
// "https://edpuzzle.com/embed/media/606b413369971e424ec6021e"
Wistia
console.log(
convertUrlToEmbedUrl("https://support.wistia.com/medias/26sk4lmiix"),
);
// "https://fast.wistia.net/embed/iframe/26sk4lmiix"
import { isValidUrl } from "@social-embed/lib";
console.log(isValidUrl("https://apple.com")); // true
console.log(isValidUrl("notaurl")); // false
FAQs
URL detection and parsing for embed providers (YouTube, other OEmbed compatible providers),
The npm package @social-embed/lib receives a total of 50 weekly downloads. As such, @social-embed/lib popularity was classified as not popular.
We found that @social-embed/lib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.