nodebb-plugin-embed
Version:
Embed media and rich content in posts: youtube, vimeo, twitch etc. All embeds are based on the rules. You are encouraged to build your own rules to embed everything what is embeddable.
102 lines • 6.22 kB
JSON
{
"rules": [
{
"name": "youtube",
"displayName": "Youtube",
"icon": "fa-youtube",
"regex": "(?:<a.*?)?(?:https?:\\/\\/)?(?:www\\.)?(?:youtube\\.com\\/(?!user|channel)\\S*(?:(?:\\/e(?:mbed))?\\/|watch\\?(?:\\S*?&?v\\=))|youtu\\.be\\/)([a-zA-Z0-9_-]{6,11})(?:.*?\\/a>)?",
"replacement": "<div class='embed-wrapper'><div class='embed-container'><iframe src='https://www.youtube.com/embed/$1' frameborder='0' allowfullscreen></iframe></div></div>"
},
{
"name": "vimeo",
"displayName": "Vimeo",
"icon": "fa-vimeo",
"regex": "(?:<a.*?)?(?:https?:\\/\\/)?(?:www\\.)?vimeo\\.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/(?:[^\\/]*)\\/videos\\/|)(\\d+)(?:|\\/\\?)(?:.*?\\/a>)?",
"replacement": "<div class='embed-wrapper'><div class='embed-container'><iframe src='https://player.vimeo.com/video/$1' frameborder='0' allowfullscreen></iframe></div></div>"
},
{
"name": "vine",
"displayName": "Vine",
"icon": "fa-vine",
"regex": "(?:<a.*?)?(?:https?:\\/\\/)?(?:www\\.)?vine\\.co\\/v\\/([a-zA-Z0-9_-]{6,11})(?:.*?\\/a>)?",
"replacement": "<div class='embed-wrapper embed-vine'><div class='embed-container'><iframe src='https://vine.co/v/$1/embed/simple' frameborder='0'></iframe></div></div>"
},
{
"name": "coub",
"displayName": "Coub",
"icon": "fa-cube",
"regex": "(?:<a.*?)?(?:https?:\\/\\/)?(?:www\\.)?coub\\.com\\/view\\/([a-zA-Z0-9_-]{4,11})(?:.*?\\/a>)?",
"replacement": "<div class='embed-wrapper'><div class='embed-container'><iframe src='https://coub.com/embed/$1?muted=false&autostart=false&originalSize=false&hideTopBar=true&startWithHD=true' frameborder='0' allowfullscreen></iframe></div></div>"
},
{
"name": "twitch-live",
"displayName": "Twitch Live",
"icon": "fa-twitch",
"regex": "(?:<a.*?)?(?:https?:\\/\\/)?(?:www\\.)?twitch\\.tv(?!.*\\/v\\/)\\/([a-zA-Z0-9_-]+)(?:.*?\\/a>)?",
"replacement": "<div class='embed-wrapper'><div class='embed-container'><iframe src='https://player.twitch.tv/?autoplay=false&channel=$1' frameborder='0' allowfullscreen></iframe></div></div>"
},
{
"name": "twitch-vod",
"displayName": "Twitch VoD",
"icon": "fa-twitch",
"regex": "(?:<a.*?)?(?:https?:\\/\\/)?(?:www\\.)?twitch\\.tv\\/.*\\/v\\/(\\d+)(?:.*?\\/a>)?",
"replacement": "<div class='embed-wrapper'><div class='embed-container'><iframe src='https://player.twitch.tv/?autoplay=false&video=v$1' frameborder='0' allowfullscreen></iframe></div></div>"
},
{
"name": "twitter",
"displayName": "Twitter",
"icon": "fa-twitter",
"regex": "(?:<a.*?)?(?:https?:\\/\\/)?(?:twitter\\.com)\/([^\/\"\\s]*)\/status\/([^\/\"\\s]*)(\/photo\/\\d|)(?:.*?\\/a>)?",
"replacement": "<div class='embed-wrapper'><blockquote class='twitter-tweet'><a href='https://twitter.com/$1/status/$2?ref_src=twsrc%5Etfw'></a></blockquote><script async src='https://platform.twitter.com/widgets.js' charset='utf-8'></script></div>"
},
{
"name": "dailymotion",
"displayName": "Dailymotion",
"icon": "fa-film",
"regex": "(?:<a.*?)?(?:https?:\\/\\/)?(?:www\\.)?dailymotion\\.com\\/video\\/([a-zA-Z0-9_-]{4,11})(?:.*?\\/a>)?",
"replacement": "<div class='embed-wrapper'><div class='embed-container'><iframe src='//www.dailymotion.com/embed/video/$1' frameborder='0' allowfullscreen></iframe></div></div>"
},
{
"name": "framatube",
"displayName": "FramaTube",
"icon": "fa-film",
"regex": "(?:<a.*?)?(?:https?:\\/\\/)?(?:www\\.)?framatube\\.org\\/videos\\/watch\\/([a-zA-Z0-9_-]{4,36})(?:.*?\\/a>)?",
"replacement": "<div class='embed-wrapper'><div class='embed-container'><iframe src='//framatube.org/videos/embed/$1' frameborder='0' allowfullscreen></iframe></div></div>"
},
{
"name": "blender",
"displayName": "Blender Tube",
"icon": "fa-film",
"regex": "(?:<a.*?)?(?:https?:\\/\\/)?(?:www\\.)?video\\.blender\\.org\\/videos\\/watch\\/([a-zA-Z0-9_-]{4,36})(?:.*?\\/a>)?",
"replacement": "<div class='embed-wrapper'><div class='embed-container'><iframe src='//video.blender.org/videos/embed/$1' frameborder='0' allowfullscreen></iframe></div></div>"
},
{
"name": "cinelibre",
"displayName": "Ciné Libre",
"icon": "fa-film",
"regex": "(?:<a.*?)?(?:https?:\\/\\/)?(?:www\\.)?video\\.cabane-libre\\.org\\/videos\\/watch\\/([a-zA-Z0-9_-]{4,36})(?:.*?\\/a>)?",
"replacement": "<div class='embed-wrapper'><div class='embed-container'><iframe src='//video.cabane-libre.org/videos/embed/$1' frameborder='0' allowfullscreen></iframe></div></div>"
},
{
"name": "soundcloud",
"displayName": "SoundCloud",
"icon": "fa-soundcloud",
"regex": "(?:<a.*?)?(?:https?:\\/\\/)?(?:www\\.)?soundcloud\\.com\\/([a-zA-Z0-9_^/-]{4,250})(?:.*?\\/a>)?",
"replacement": "<div class='embed-wrapper'><div class='embed-container'><iframe scrolling='no' frameborder='no' allow='autoplay' src='https://w.soundcloud.com/player/?url=https://soundcloud.com/$1&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true'></iframe></div></div>"
},
{
"name": "mixcloud",
"displayName": "MixCloud",
"icon": "fa-mixcloud",
"regex": "(?:<a.*?)?(?:https?:\\/\\/)?(?:www\\.)?mixcloud\\.com\\/([a-zA-Z0-9_-]{4,36})\\/([a-zA-Z0-9_-]{4,136})(?:.*?\\/a>)?",
"replacement": "<div class='embed-wrapper'><div class='embed-container'><iframe src='https://www.mixcloud.com/widget/iframe/?light=1&hide_artwork=1&feed=%2F$1%2F$2%2F' frameborder='0'></iframe></div></div>"
},
{
"name": "spotify",
"displayName": "Spotify",
"icon": "fa-spotify",
"regex": "(?:<a.*?)?(?:https?:\\/\\/)?(?:www\\.)?open\\.spotify\\.com\\/album\\/([a-zA-Z0-9_-]{4,36})(?:.*?\\/a>)?",
"replacement": "<div class='embed-wrapper'><div class='embed-container'><iframe src='https://open.spotify.com/embed/album/$1' frameborder='0' allowtransparency='true' allow='encrypted-media'></iframe></div></div>"
}
]
}