https://github.com/platzidev/markdown-it-video
https://github.com/platzidev/markdown-it-video
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/platzidev/markdown-it-video
- Owner: PlatziDev
- Created: 2020-07-08T19:09:35.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-08T19:12:07.000Z (almost 6 years ago)
- Last Synced: 2025-04-13T00:19:16.368Z (about 1 year ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 1
- Watchers: 40
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# markdown-it-video
> markdown-it plugin for embedding hosted videos.
[](https://travis-ci.org/brianjgeiger/markdown-it-video)
## Usage
#### Enable plugin
```js
var md = require('markdown-it')({
html: true,
linkify: true,
typography: true
}).use(require('markdown-it-video', { // <-- this use(package_name) is required
youtube: { width: 640, height: 390 },
vimeo: { width: 500, height: 281 },
vine: { width: 600, height: 600, embed: 'simple' },
prezi: { width: 550, height: 400 }
}));
```
#### YouTube
This only works in the inline style.
```md
@[youtube](dQw4w9WgXcQ)
```
is interpreted as
```html
```
Alternately, you could use a number of different YouTube URL formats rather than just the video id.
```md
@[youtube](http://www.youtube.com/embed/dQw4w9WgXcQ)
@[youtube](https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=feedrec_centerforopenscience_index)
@[youtube](http://www.youtube.com/user/IngridMichaelsonVEVO#p/a/u/1/QdK8U-VIH_o)
@[youtube](http://www.youtube.com/v/dQw4w9WgXcQ?fs=1&hl=en_US&rel=0)
@[youtube](http://www.youtube.com/watch?v=dQw4w9WgXcQ#t=0m10s)
@[youtube](http://www.youtube.com/embed/dQw4w9WgXcQ?rel=0)
@[youtube](http://www.youtube.com/watch?v=dQw4w9WgXcQ)
@[youtube](http://youtu.be/dQw4w9WgXcQ)
```
#### Vimeo
This only works in the inline style.
```md
@[vimeo](19706846)
```
is interpreted as
```html
```
Alternately, you could use the url instead of just the video id.
```md
@[vimeo](https://vimeo.com/19706846)
@[vimeo](https://player.vimeo.com/video/19706846)
```
#### Vine
This only works in the inline style.
```md
@[vine](etVpwB7uHlw)
```
is interpreted as
```html
```
Alternately, you could use the url, or even the whole embed tag instead of just the video id.
```md
@[vine](https://vine.co/v/etVpwB7uHlw/embed/simple)
@[vine](https://vine.co/v/etVpwB7uHlw/embed/postcard?audio=1)
@[vine]()
```
#### Prezi
This only works in the inline style.
```md
@[prezi](1kkxdtlp4241)
```
is interpreted as
```html
```
Alternately, you could use the url.
```md
@[prezi](https://prezi.com/1kkxdtlp4241/valentines-day/)
@[prezi](https://prezi.com/e3g83t83nw03/destination-prezi-template/)
@[prezi](https://prezi.com/prg6t46qgzik/anatomy-of-a-social-powered-customer-service-win/)
```
## Options
```js
```