Badges
Installing
npm package
npm install @loomhq/loom-embed
See the CHANGELOG.md for the latest version
Usage
import * as loom from '@loomhq/loom-embed';
Methods
.linkReplace(selector, [options], target)
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.
.textReplace(textString, [options])
Takes a string and replaces any Loom URLs with the embed html
-> returns a promise
.oembed(videoUrl, [options])
oembed metadata from the given video url
-> returns a promise
Options
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
Development
Documentation/Examples
For working examples of each method run the local dev server
npm start
visit http://localhost:8989/
in your browser
Running tests
npm test