CenterForOpenScience/markdown-it-video

Name: markdown-it-video

Owner: Center for Open Science

Description: markdown-it plugin for embedding hosted videos.

Created: 2015-02-05 16:11:54.0

Updated: 2018-04-23 14:37:49.0

Pushed: 2018-03-19 20:51:42.0

Homepage: https://github.com/markdown-it/markdown-it

Size: 105

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

markdown-it-video

markdown-it plugin for embedding hosted videos.

Build Status

Usage
Enable plugin
md = require('markdown-it')({
ml: true,
nkify: true,
pography: true
se(require('markdown-it-video', { // <-- this use(package_name) is required
utube: { width: 640, height: 390 },
meo: { width: 500, height: 281 },
ne: { width: 600, height: 600, embed: 'simple' },
ezi: { width: 550, height: 400 }

Inline style

This plugin is made to work in the inline style. If you'd like a block-style, you may be interested in https://github.com/rotorz/markdown-it-block-embed

YouTube
utube](dQw4w9WgXcQ)

is interpreted as

div class="embed-responsive embed-responsive-16by9"><iframe class="embed-responsive-item" id="youtubeplayer" type="text/html" width="640" height="390"
c="//www.youtube.com/embed/dQw4w9WgXcQ"
ameborder="0"/></div></p>

Alternately, you could use a number of different YouTube URL formats rather than just the video id.

utube](http://www.youtube.com/embed/dQw4w9WgXcQ)
utube](https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=feedrec_centerforopenscience_index)
utube](http://www.youtube.com/user/IngridMichaelsonVEVO#p/a/u/1/QdK8U-VIH_o)
utube](http://www.youtube.com/v/dQw4w9WgXcQ?fs=1&amp;hl=en_US&amp;rel=0)
utube](http://www.youtube.com/watch?v=dQw4w9WgXcQ#t=0m10s)
utube](http://www.youtube.com/embed/dQw4w9WgXcQ?rel=0)
utube](http://www.youtube.com/watch?v=dQw4w9WgXcQ)
utube](http://youtu.be/dQw4w9WgXcQ)
Vimeo
meo](19706846)

is interpreted as

div class="embed-responsive embed-responsive-16by9"><iframe class="embed-responsive-item" id="vimeoplayer" type="text/html" width="500" height="281"
c="//player.vimeo.com/video/19706846"
ameborder="0"/></div></p>

Alternately, you could use the url instead of just the video id.

meo](https://vimeo.com/19706846)
meo](https://player.vimeo.com/video/19706846)
Vine
ne](etVpwB7uHlw)

is interpreted as

div class="embed-responsive embed-responsive-16by9"><iframe class="embed-responsive-item" id="vineplayer" type="text/html" width="600" height="600"
c="//vine.co/v/etVpwB7uHlw/embed/simple"
ameborder="0"/></div></p>

Alternately, you could use the url, or even the whole embed tag instead of just the video id.

ne](https://vine.co/v/etVpwB7uHlw/embed/simple)
ne](https://vine.co/v/etVpwB7uHlw/embed/postcard?audio=1)
ne](<iframe src="https://vine.co/v/etVpwB7uHlw/embed/simple?audio=1" width="600" height="600" frameborder="0"></iframe><script src="https://platform.vine.co/static/scripts/embed.js"></script>)
Prezi
ezi](1kkxdtlp4241)

is interpreted as

div class="embed-responsive embed-responsive-16by9"><iframe class="embed-responsive-item" id="preziplayer" type="text/html" width="550" height="400" src="https://prezi.com/embed/1kkxdtlp4241/?bgcolor=ffffff&amp;lock_to_path=0&amp;autoplay=0&amp;autohide_ctrls=0&amp;landing_data=bHVZZmNaNDBIWnNjdEVENDRhZDFNZGNIUE43MHdLNWpsdFJLb2ZHanI5N1lQVHkxSHFxazZ0UUNCRHloSXZROHh3PT0&amp;landing_sign=1kD6c0N6aYpMUS0wxnQjxzSqZlEB8qNFdxtdjYhwSuI" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div></p>

Alternately, you could use the url.

ezi](https://prezi.com/1kkxdtlp4241/valentines-day/)
ezi](https://prezi.com/e3g83t83nw03/destination-prezi-template/)
ezi](https://prezi.com/prg6t46qgzik/anatomy-of-a-social-powered-customer-service-win/)
OSF

This plugin allows you to use the OSF's Modualar File Renderer or the MFR to embed video or other files into your markdown assuming your page has mfr.js and mfr.css loaded.

f](kuvg9)

is interpreted as

div id="randomid" class="mfr mfr-file"></div><script>$(document).ready(function () {new mfr.Render("randomid", "https://mfr.osf.io/render?url=https://osf.io/kuvg9/?action=download%26mode=render");    }); </script></p>

Alternately, you could use the url.

f](https://mfr.osf.io/render?url=https://osf.io/kuvg9/?action=download)
Options

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.