@loomhq/loom-embed
Version:
SDK for easily embedding videos
51 lines (30 loc) • 1.53 kB
Markdown
[](https://www.npmjs.com/package/@loomhq/loom-embed)
[](https://app.circleci.com/pipelines/github/loomhq/platform/2351/workflows/54eaa124-7378-48ac-80a7-a83ee3195322)
[]()
```sh
npm install @loomhq/loom-embed
```
```html
<script type="module"> import * as loom from "https://www.unpkg.com/@loomhq/loom-embed@1.2.4/dist/esm/index.js?module"; </script>
```
See [documentation](https://dev.loom.com/docs/embed-sdk/getting-started) for installation and usage.
```js
import * as loom from '@loomhq/loom-embed';
````
Replaces any loom links at the nodes matching the selector with the embedded video. Replacement occurs on the entire document, or on the optional target DOM element.
Takes a string and replaces any Loom URLs with the embed html
_-> returns a promise_
oembed metadata from the given video url
_-> returns a promise_
**The embed code is responsive by default. Only set the width/height values if you require your embed code to be a fixed size**
`width` - [Number] value specifying the max pixel width
`height` - [Number] value specifying the max pixel height