Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
carta-plugin-video
Advanced tools
Readme
This plugin adds ability to render online video from Youtube or Vimeo.
Inspired by markdown-it-video
npm i carta-plugin-video
Import the default theme, or create you own:
import 'carta-plugin-video/default.css';
Note that the align
function needs the default css to work properly.
For custom styles, this is an example of the generated HTML:
<div class="video-container center">
<iframe
width="640"
height="390"
src="<the URL>"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe>
</div>
<script>
import { Carta, CartaEditor } from 'carta-md';
import { video } from 'carta-plugin-video';
import 'carta-plugin-video/default.css';
const carta = new Carta({
extensions: [
video({
// Optional options
}),
],
});
</script>
<CartaEditor {carta} />
You can use either video ID (e.g: dQw4w9WgXcQ
) or video URL (e.g: https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley
)
For Youtube:
@[youtube](dQw4w9WgXcQ)
@[youtube](https://www.youtube.com/watch?v=dQw4w9WgXcQ)
For Vimeo:
@[vimeo](347119375)
@[vimeo](https://vimeo.com/347119375)
Here are the options you can pass to video()
:
export interface VideoExtensionOptions {
/**
* Width of the video (in pixels or percentage string), defaults to 640.
*/
width?: number | string;
/**
* Height of the video (in pixel or percentage string), defaults to 360.
*/
height?: number | string;
/**
* Horizontal alignment of the video, defaults to 'center'.
*/
align?: 'left' | 'center' | 'right';
/**
* Allow fullscreen, defaults to true.
*/
allowFullscreen?: boolean;
/**
* Use youtube-nocookie.com domain, defaults to false.
*/
noCookie?: boolean;
}
FAQs
This plugin adds ability to render online video from Youtube or Vimeo.
The npm package carta-plugin-video receives a total of 145 weekly downloads. As such, carta-plugin-video popularity was classified as not popular.
We found that carta-plugin-video demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.